Copy link to clipboard
Copied
Hi,
is it possible to create a new page in a PDF when a button is pressed? What would be the js-code for this?
Thanks
Copy link to clipboard
Copied
Yes, it's possible. The basic code would be simply:
this.newPage();
This will add a page to the end of the file, sized 612x792.
You can customize the location and size of the page by using parameters.
Read the documentation of this method for more details.
Of course, this will not work in Reader, only in Acrobat...
Copy link to clipboard
Copied
Thanks a lot.
My goal is to insert a picture in a new page:
1) a button is pressed -> a new page is created
2) a field is created in the new page where the picture will be inserted
3) the user press the field and navigate to the picture repertory (event.target.buttonImportIcon();)
4) The user insert the picture in the field
So how can I insert a new field for picture in the new page in js?
Copy link to clipboard
Copied
After creating the new page you can add a field to it using the addField method.
I would recommend that you look into using a Template instead, though. That will work in Reader and you won't need to create everything on the spot. You could create it in advance and just spawn the template when needed.
Copy link to clipboard
Copied
I tested the function this.newPage(); without success. I'm using Adobe Standard DC.
- I added a new button in PDF
- In its properties, I set: on mouse up -> execute js -> I added this.newPage(); => I tested and no page is created.
About the using of templates, where can I get more information about it? I want my solution to work in Reader.
Copy link to clipboard
Copied
Using this function requires a privileged context, ie it needs to run from a folder-level script that's installed on the user's local machine.
Regarding the templates: This issue was discussed here many times. Try searching around...
Copy link to clipboard
Copied
Hi,
I searched how to use the templates and can now use the following js-code:
var t = this.getTemplate("Bildmangel");
t.spawn({nPage: pageNum + 1, bRename: true, bOverlay: false});
It looks like the defined template must be in the same PDF where the code is used. What if I want a template from another PDF document to be spawned in my current PDF?
Copy link to clipboard
Copied
Not possible.
Copy link to clipboard
Copied
If I use the scan function of the android adobe reader to make some pictures, a new PDF will be created. How can I integrate that PDF with pictures in an existing PDF so that I have only one PDF?
The goal is that the user fills a PDF with data and join some pictures to that PDF.
Copy link to clipboard
Copied
With Adobe PDF Pack you can combine PDF files on mobile devices.