drop item in pdf appearing in modal with jquery












0














I have a task to recreate adobe acrobat's pdf signature part,where user can create its signature and drag and drop on the pdf. I am successful in creating signature pad and after creating signature user is able to drag the signature and drop on desired position in pdf which is appearing in a bootstrap modal. But Signature is not responding to pdf's scroll bar but the browser's scroll.When i click inspect to see position of signature its showing style="position: relative; left: 56px; top: 204px;" in browser's inspect not in pdf's inspect. How can i insert it's position in pdf?



<body>
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
<div style="text-align: center;" class="test">
<div id = "draggable-1" class = "ui-widget-content">
<p>Drag me to my target</p>
</div>

<div class="pdfff drop-zone">

</div>


</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary">I Agree</button>
</div>
</div>
</div>
</div>


<script>

$(document).ready(function(){
var doc = new jsPDF();
doc.text(20, 20, 'Hello world!');
doc.text(20, 30, 'This is client-side Javascript, pumping out a PDF.');
doc.addPage();
doc.text(20, 20, 'Do you like that?');

doc.text(10, 125, 'CheckBox:');
var checkBox = new CheckBox();
checkBox.T = "CheckBox1";
checkBox.Rect = [50, 120, 30, 10];
doc.addField(checkBox);

// Output as Data URI
res = doc.output('datauri')
$(".pdfff").append("<embed src='"+ res +"' frameborder='0' width='100%' height='650px;' id='doc'>")

})

$(function() {
$( "#draggable-1" ).draggable({
appendTo: 'body',
scroll: true,
});
$( ".pdfff" ).droppable();
});
</script>

</body>


enter image description here










share|improve this question






















  • If anybody is having problem in understanding then please tell me how can i use drop and drag in a pdf?
    – Chidananda Nayak
    Nov 21 at 7:04
















0














I have a task to recreate adobe acrobat's pdf signature part,where user can create its signature and drag and drop on the pdf. I am successful in creating signature pad and after creating signature user is able to drag the signature and drop on desired position in pdf which is appearing in a bootstrap modal. But Signature is not responding to pdf's scroll bar but the browser's scroll.When i click inspect to see position of signature its showing style="position: relative; left: 56px; top: 204px;" in browser's inspect not in pdf's inspect. How can i insert it's position in pdf?



<body>
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
<div style="text-align: center;" class="test">
<div id = "draggable-1" class = "ui-widget-content">
<p>Drag me to my target</p>
</div>

<div class="pdfff drop-zone">

</div>


</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary">I Agree</button>
</div>
</div>
</div>
</div>


<script>

$(document).ready(function(){
var doc = new jsPDF();
doc.text(20, 20, 'Hello world!');
doc.text(20, 30, 'This is client-side Javascript, pumping out a PDF.');
doc.addPage();
doc.text(20, 20, 'Do you like that?');

doc.text(10, 125, 'CheckBox:');
var checkBox = new CheckBox();
checkBox.T = "CheckBox1";
checkBox.Rect = [50, 120, 30, 10];
doc.addField(checkBox);

// Output as Data URI
res = doc.output('datauri')
$(".pdfff").append("<embed src='"+ res +"' frameborder='0' width='100%' height='650px;' id='doc'>")

})

$(function() {
$( "#draggable-1" ).draggable({
appendTo: 'body',
scroll: true,
});
$( ".pdfff" ).droppable();
});
</script>

</body>


enter image description here










share|improve this question






















  • If anybody is having problem in understanding then please tell me how can i use drop and drag in a pdf?
    – Chidananda Nayak
    Nov 21 at 7:04














0












0








0







I have a task to recreate adobe acrobat's pdf signature part,where user can create its signature and drag and drop on the pdf. I am successful in creating signature pad and after creating signature user is able to drag the signature and drop on desired position in pdf which is appearing in a bootstrap modal. But Signature is not responding to pdf's scroll bar but the browser's scroll.When i click inspect to see position of signature its showing style="position: relative; left: 56px; top: 204px;" in browser's inspect not in pdf's inspect. How can i insert it's position in pdf?



<body>
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
<div style="text-align: center;" class="test">
<div id = "draggable-1" class = "ui-widget-content">
<p>Drag me to my target</p>
</div>

<div class="pdfff drop-zone">

</div>


</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary">I Agree</button>
</div>
</div>
</div>
</div>


<script>

$(document).ready(function(){
var doc = new jsPDF();
doc.text(20, 20, 'Hello world!');
doc.text(20, 30, 'This is client-side Javascript, pumping out a PDF.');
doc.addPage();
doc.text(20, 20, 'Do you like that?');

doc.text(10, 125, 'CheckBox:');
var checkBox = new CheckBox();
checkBox.T = "CheckBox1";
checkBox.Rect = [50, 120, 30, 10];
doc.addField(checkBox);

// Output as Data URI
res = doc.output('datauri')
$(".pdfff").append("<embed src='"+ res +"' frameborder='0' width='100%' height='650px;' id='doc'>")

})

$(function() {
$( "#draggable-1" ).draggable({
appendTo: 'body',
scroll: true,
});
$( ".pdfff" ).droppable();
});
</script>

</body>


enter image description here










share|improve this question













I have a task to recreate adobe acrobat's pdf signature part,where user can create its signature and drag and drop on the pdf. I am successful in creating signature pad and after creating signature user is able to drag the signature and drop on desired position in pdf which is appearing in a bootstrap modal. But Signature is not responding to pdf's scroll bar but the browser's scroll.When i click inspect to see position of signature its showing style="position: relative; left: 56px; top: 204px;" in browser's inspect not in pdf's inspect. How can i insert it's position in pdf?



<body>
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
<div style="text-align: center;" class="test">
<div id = "draggable-1" class = "ui-widget-content">
<p>Drag me to my target</p>
</div>

<div class="pdfff drop-zone">

</div>


</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary">I Agree</button>
</div>
</div>
</div>
</div>


<script>

$(document).ready(function(){
var doc = new jsPDF();
doc.text(20, 20, 'Hello world!');
doc.text(20, 30, 'This is client-side Javascript, pumping out a PDF.');
doc.addPage();
doc.text(20, 20, 'Do you like that?');

doc.text(10, 125, 'CheckBox:');
var checkBox = new CheckBox();
checkBox.T = "CheckBox1";
checkBox.Rect = [50, 120, 30, 10];
doc.addField(checkBox);

// Output as Data URI
res = doc.output('datauri')
$(".pdfff").append("<embed src='"+ res +"' frameborder='0' width='100%' height='650px;' id='doc'>")

})

$(function() {
$( "#draggable-1" ).draggable({
appendTo: 'body',
scroll: true,
});
$( ".pdfff" ).droppable();
});
</script>

</body>


enter image description here







javascript jquery html pdf






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 at 6:43









Chidananda Nayak

349112




349112












  • If anybody is having problem in understanding then please tell me how can i use drop and drag in a pdf?
    – Chidananda Nayak
    Nov 21 at 7:04


















  • If anybody is having problem in understanding then please tell me how can i use drop and drag in a pdf?
    – Chidananda Nayak
    Nov 21 at 7:04
















If anybody is having problem in understanding then please tell me how can i use drop and drag in a pdf?
– Chidananda Nayak
Nov 21 at 7:04




If anybody is having problem in understanding then please tell me how can i use drop and drag in a pdf?
– Chidananda Nayak
Nov 21 at 7:04

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53406552%2fdrop-item-in-pdf-appearing-in-modal-with-jquery%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53406552%2fdrop-item-in-pdf-appearing-in-modal-with-jquery%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

404 Error Contact Form 7 ajax form submitting

How to know if a Active Directory user can login interactively

Refactoring coordinates for Minecraft Pi buildings written in Python