jsreport / jsreport-pdf-utils

jsreport extension providing pdf operations like merge or concatenation
MIT License
8 stars 4 forks source link

PDF Document Information Dictionary needs to be an indirect reference #19

Closed melissa-edge-il closed 5 years ago

melissa-edge-il commented 5 years ago

I'm seeing a couple issues with pdfs generated using pdf-utils.

I found these with jsreport version 2.0, but could reproduce on the current jsreport playground (version 2.5.)

Here's what I'm seeing:

I believe these issues stem from the /Info section of the document trailer. Adobe's specification requires that the Info dictionary be an indirect reference. (here, page 88/978 of the document itself.) It seems that every pdf I generate with pdf-utils uses an actual dictionary in the trailer instead of a reference. I've tried using simple to complex templates with many combinations of operations and options, and have seen this same thing each time. When I use jsreport to generate pdfs without pdf-utils, the info dictionary is indirectly referenced, and I don't see either of the issues mentioned.

When I manipulate the pdfs by hand, creating a separately-referenced Info dictionary object, both issues disappear. I can save just fine in adobe products, and the document title shows up properly in a browser tab title.

pofider commented 5 years ago

Thanks. You are right, they mention it in the specification. We will fix it.

melissa-edge-il commented 5 years ago

Thanks so much for fixing this @pofider! When can we expect to see it pushed out to jsreport?

pofider commented 5 years ago

You can install github dependency from master and have it working right now

npm i jsreport/jsreport-pdf-utils

We don't have a strict schedule for releasing jsreport. It is always every few months. I guess it will happen somewhen in August.

melissa-edge-il commented 5 years ago

Quick question: will these changes still be pulled in on a new version of jsreport without a new release on pdf-utils? Not sure how Github releases work.

bjrmatos commented 5 years ago

@melissa-edge-il first we will release new version of jsreport-pdf-utils and then that new version will be included in the next release of jsreport (2.6.0).