Home > Mobile >  SSRS Set the generated PDFs version to 1.3
SSRS Set the generated PDFs version to 1.3

Time:11-26

I am using SSRS version 15.0.1102.897. When I generate PDF files using this version the PDF gets set to version 1.7.

I have another instance of SSRS running version 13.0.2216.0 and when I generate PDF files using this version, the PDF gets set to version 1.3.

The issue I'm running into is that I'm using a FPDI PDF-Parser Library to merge the generated files together but this library only supports up to PDF version 1.4 for merging.

Is there a way to force the generated PDF in the v15 SSRS instance to be PDF version 1.3 or 1.4 instead of 1.7?

Thanks in advance

CodePudding user response:

Looking through RSReportServer.Config description that value seems not to be accessible (pun) to configurators.

SSRS as you note is now designed for features found in version 1.7 upwards but may work primarily using 1.3 compatible objects.

The simplest solution may be to use a binary/hex patchier to replace the 8 bytes %PDF-1.7 header string with %PDF-1.3 (do NOT use an ascii string find and replace such as sed/grep), if you want to try the dirty way you need either https://sourceforge.net/projects/bbe- or other equivalent to hexdump then modify then hex2bin and verify no byte change in file size (not even one byte /- since the trailer would be corrupted)

However there is no guarantee that any 1.5 or above objects will not break FPDI so for best compatibility you could parse through Ghostscript to "down-level"

for more details see related question and old link here https://stackoverflow.com/a/51002675/10802527

Do follow the link to iconic blog but the modern command line can be shorter so try the traditional

<?php
exec('gs -sDEVICE=pdfwrite -o="'.$srcfile_new.'" "'.$srcfile.'"'); 
?>

and also try for comparison using 9.55 additional -dNEWPDF

CodePudding user response:

The PDF version is updated to the highest PDF version you'd imported pages from with FPDI.

If you want to keep it at PDF 1.3 or PDF 1.4 you have to make sure that the PDF documents you import pages from have no higher version.

  • Related