Focal Point
[SOLVED] Compressing PDF

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8917060886

October 18, 2017, 03:00 PM
eric.woerle
[SOLVED] Compressing PDF
I have a process that puts a large amount of images into a PDF. Because of this the files are getting quite large. Anywhere from a few hundred MB to multiple GBs. So I'm trying to use GhostScript to compress the file and then call EDAGET to display it back out. Unfortunately EDAGET is returning a blank file instead of the results of the PDF. If I pull the file off manually using WinSCP, I get the correct result. Am I doing something wrong? Or should I just scp the file over to the Web Server and pull it back using Francis' suggestions in this thread: http://forums.informationbuild...647047666#8647047666 ?

Here is my sample code:
FILEDEF TEST_PDF DISK baseapp/test_pdf.pdf 
-RUN

TABLE FILE CAR
SUM RETAIL_COST DEALER_COST
BY COUNTRY 
BY CAR
ON TABLE HOLD AS TEST_PDF FORMAT PDF
END
-RUN

-SET &MYRETURN=SYSTEM(1000,'gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -sOutputFile=&FOLDER_LOC.EVAL/test_pdf_new.pdf &FOLDER_LOC.EVAL/test_pdf.pdf','D3');

-RUN

-MRNOEDIT EX EDAGET PDF,baseapp/test_pdf_new.pdf,b
  

This message has been edited. Last edited by: FP Mod Chuck,


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
October 18, 2017, 06:06 PM
FP Mod Chuck
Hi Eric

One option is to use ReportCaster which can e-mail or FTP and zip the output.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
October 19, 2017, 10:06 AM
eric.woerle
Thanks Chuck,

I'll keep that in mind, but zipping and emailing the file would most likely annoy my end users and not work in this case. I need to find a way to present it back to the end user for download from the page. I know that FOCUS has the SET FILECOMPRESS = ON command, but from my understanding this doesn't compress the images (which seems accurate from the testing I've done). Do you know if there is anything in the pipeline for IBI to include images in the PDF file compression command?


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
October 19, 2017, 10:09 AM
FP Mod Chuck
Hi Eric

I will see what I can find out.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
October 20, 2017, 03:16 PM
Doug
Have you seen any differences in file sizes for your PDFs with and without the FILECOMPRESS command? I saw as much as a 60% difference. What images are embedded in the PDFs?
quote:
SET FILECOMPRESS = ON





   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
October 23, 2017, 10:45 AM
eric.woerle
I saw a very minimal difference with SET FILECOMPRESS=ON in my testing. This seems to only compress the text portion and not the images. The report is a student roster and it contains the image of every student in the class. So I have about 10 +/- images per page with anywhere from 15 - 30 students per course. They are running this report for multiple days for multiple classes at a time, so the PDF grows rather quickly since the images aren't compressed and even duplicate images are preserved each time they appear. When I used Ghost script I saw a 90% reduction in size. My test file went from 8.8M to 669K. That is a considerable saving.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
October 26, 2017, 04:26 PM
FP Mod Chuck
Eric

The FILECOMPRESS is what it is today, if you want it enhanced please submit a new feature request. For now continue down the path you are taking.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats