Post without Account — your post will be reviewed, and if appropriate, posted under Anonymous. You can also use this link to report any problems registering or logging in.

Code with later PDF versions?

  • 2 Replies
  • 1492 Views
*

Offline Phil

  • Global Moderator
  • Sr. Member
  • *****
  • 430
    • View Profile
Code with later PDF versions?
« July 12, 2017, 06:44:19 PM »
The official output version of PDF::Builder is supposed to be PDF version 1.4. It is possible that various bits of code added over time may actually implement later versions (1.5, 1.6, 1.7), which would break output PDFs. This topic (thread) is intended for reports of code where post-1.4 output is created. At some point (see https://www.catskilltech.com/forum/general-discussions/bringing-pdfapi2-into-the-21st-century/), we will need to "guard" these outputs with a version number check, but for now we'll just list them here and maybe put a comment in the file to warn developers.

*

Offline Phil

  • Global Moderator
  • Sr. Member
  • *****
  • 430
    • View Profile
Re: Code with later PDF versions?
« Reply #1: December 01, 2017, 12:04:24 PM »
In the discussion of some issues concerning cross reference streams (RT 117184/112932, 121832, 121911) there is mention of "needing" PDF 1.5 level PDF files to demonstrate the problem. Does this mean that some aspect of cross reference streams are PDF 1.5 level? If so, we need to move ahead with implementing PDF version control, as these streams would not be legitimate PDF 1.4.
« Last Edit: December 02, 2017, 11:34:25 AM by Phil »

*

Offline Phil

  • Global Moderator
  • Sr. Member
  • *****
  • 430
    • View Profile
Re: Code with later PDF versions?
« Reply #2: October 26, 2018, 10:01:26 AM »
Code has been added (as of release 3.011) to bump up the output PDF version if a feature is marked as requiring a later PDF version (verCheckOutput call). The "bump up" of the output PDF version when a PDF of higher level is imported in some manner, is now handled more formally (verCheckInput call).

Regarding the issue raised above concerning cross reference streams, yes they are PDF 1.5. Since these should only appear in imported PDF files of version 1.5 or higher, verCheckInput() should handle it properly (i.e., the output will be PDF-1.5 or higher).

Note that verCheckOutput() is not automatic — it requires the programmer (of PDF::Builder) to be aware of the minimum PDF version required by a newly-added feature, and to add in the verCheckOutput() call. If any more PDF import calls are added, the programmer will need to call verCheckInput() for them.