1

I am using PDFObject to embed a PDF with form fields in a html page.

I would like to add a button to the page, which will cause acrobat to submit the fields back to the web server. If I was doing this within the PDF, it would look like this

Here is what I have so far, which throws an exception, because pdf does not contain a property called doc.

$(document).ready(function () {
            var pdf = new PDFObject({ url: "test.pdf" }).embed("pdf");

            $("#savebutton").button({ icons: { primary: "ui-icon-disk" }, text: true, label: "Save" });

            $("#saveButton").click(function () {
                pdf.doc.submitForm("submiturl", false);
            });
        });

So the crux of the question, how do I get access to the "doc" object within the pdf's DOM, from the page. Is this even possible?

1 Answer 1

1

I think the only way to interact with an embedded pdf is using .postMessage(), e.g.

var pdf = document.getElementById("PDFObj");
pdf.postMessage([message]);

Then you need some JavaScript in the PDF (yes, you can do that, but have fun figuring it out) to catch it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.