Skip to main content
Inspiring
September 14, 2020
Question

Print as PDF via javascript / Flattening signatures

  • September 14, 2020
  • 1 reply
  • 1108 views

Hi,

I have a signed PDF-Form "file1" that I need to mergend into another PDF "file2" that is also going to be signed later in the process. I don't need the real signatures of file1 in file2 (that doesn't work either because merging a signed PDF deletes the signatures), it suffices to preserve the signatures as textobjects in file2 (The result I'd like to have is exactly the result I get when I print file1 as a PDF (e.g. with printer "Adobe PDF"). Hereby the signatures will be obtained as texts in the printed PDF.).

So I claim to have to adjust file1 before merging to file2. Because I need this for about 100x a month, it should work with a javascript-button (folder level).

 

For adjusting file1 I had two approaches, both don't work:

 

Approach 1: Print as PDF via javascript

I found out that there is no way to print as PDF via Javascript. Is that true? Somehow like the printparams.filename does not work with a printer that opens a save dialog on its own. Is there any other possibility to get that?

 

Approach 2: Flatten the PDF via javascript

I tried this.flattenPages(), but that doesn't work with signatures...

 

Is there any possibility to get what I want?

Thanks!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
September 14, 2020

You can't merge a signed PDF file with another file. Your whole approach to this is wrong. You need to first merge the two files, and then sign them. Doing it the other way around will either not work at all or will result in a file that is not signed.

Lukas5E13Author
Inspiring
September 14, 2020

I know that. But that's what our process look like. We don't need the "real" signatures of file1 in file2. So, yes, my approach will result in a file that is not signed. That's what I want to get.

 

Is there any possibility to get that?

 

[P.S. The background of the process is: We get file1 and sign file1. Two weeks later we have to attach file1 to file2 to get file2 to be signed by others. The person that signs file2 does not need to validate the signature of file1 (that's what other persons already did) so it's absolutely correct to lose the "real" signature". But to avoid questions we'd like to have the signature-suff still printed in the attachment.]

try67
Community Expert
Community Expert
September 14, 2020

A "printed" copy of a digital signature is meaningless. You might as well not have it all. In fact, not having it at all is better because some people might believe that the printed signature field means the file is signed, when in fact it's not. So I would say just use the original, unsigned version of file1 for the merging.