Skip to main content
Participating Frequently
May 28, 2021
Question

export PDF in uncompressed format

  • May 28, 2021
  • 2 replies
  • 1846 views

Hi all.

 

I have a pdf with a lot of javascript handlers inside, which runs on various events: onpageopen, onpageclose etc.

 

If I look at the PDF with a text editor it looks like this:

 

<</Type /XRef/W[1 4 2]/Index[0 28]/Size 28/Filter /FlateDecode/DecodeParms<</Columns 7/Predictor

12>>/Length 97/Root 1 0 R /ID[<1BA5941DD3C4ED7AD477F1F3AFEB5A57><FA40370C22EDC77028A3FDBB8C3B12E1>]>>stream
xœcb ÿÿ™” ##Ó ýž‰ HKi3RŒ]@¨îÿaF&°>
è@òÃw(fu_@ö2ށº£ âŽ;x1ÔÝËüŸá#ˆÏúš ÍcF
endstream
endobj

 

My goal is to decompress the internal structure, whilst keeping the pdf valid, so that I can easily view and edit Javascript for all event handlers.

 

Any idea how I could export the PDF to achieve this? Thanks!

This topic has been closed for replies.

2 replies

Legend
May 28, 2021

Acrobat will no longer do this (not for about 20 years). EVEN if it were uncompressed, editing any text will break the PDF. An uncompressed PDF is not just editable text. You MUST use a PDF JavaScript editor.

Participating Frequently
May 28, 2021

ok,

 

different question then?

 

is there a way to build a pdf programmatically?

 

and add all these javascript handlers using a pythn script for example?

Thom Parker
Community Expert
Community Expert
May 28, 2021

Yes, what you need is a PDF Library or tool that works with Python.  I'm pretty sure there are several. 

But you could also do this in Acrobat with a script. 

 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Thom Parker
Community Expert
Community Expert
May 28, 2021

Ha ha. The simple answer is no, you can't do this for many different reasons. 

If you want to understand why I suggest you read the first part of the PDF Specification on the file format.

 

 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often