Add Page / Clone Page / Remove Page - NotAllowedError

Previous topic - Next topic

shadow_no

Hello all,
first of all thanks for you work a lot!

I have a problem with creating PDF forms, especially with one function I need to implement. The thing is I need to dynamically add pages depends on some user action. For example when user "check" one field, the additional page should appear. Or if he click some button the next page should be hide/delete.

Unfortunately all functions I tried to use for example addPages, deletePages etc. are not work because of the error "NotAllowedError: Security settings prevent access to this property or method."
I`m stuck now. I read about "privilege" and "trusted functions" but at this moment I have no success and I need help with move on. Did someone successfully implemented similar function in their project?

Best regards,
TN


Nermander

Are you sure that is something that is possible with PDF forms? I am not sure forms allow for modifying anything except the contents of the form fields.

shadow_no

Hi Nermander,
yes it is possible. Check this file: https://www.podatki.gov.pl/media/7033/pit-37-27-_v1-0e_20.pdf
When you mark those fields:



The extra page will appear at the end of the document. This is what Im trying to do without success :(

a.l.e

i'm no fan of interactive pdfs... but i was curious and made some research.

it seems indeed possible to get javascript to "add" (and remove) pages in a pdf document.

what you need are pages that are defined as template.

and i'm not sure if there is any viewer but the acrobat one that support the feature.
(i can't read polish and i have a hard time to follow what happens when clicking that box, but i don't have the feeling that a page gets added in firefox' pdf viewer...)

on the other side, i could not find any sign in scribus that creating page templates in pdfs would be supported.
and i haven't find much documentation about it.

if the feature is important to you, you can dig into the pdf specs and make a proposal, how scribus could implement it.

the best description i've found is:

https://stackoverflow.com/questions/30460835/how-to-show-hide-a-page-of-a-pdf-form-by-checking-or-unchecking-a-check-box

it does not have to be hard to implement...