Solved Abnormal filesize when using SalReportPrintToFile() for PDF

Discussion forum about all things Report Builder (all versions).
Alexander

Abnormal filesize when using SalReportPrintToFile() for PDF

Post by Alexander » 07 Oct 2016, 13:52

Hi @all,

I'm using SalReportPrintToFile() to print a report as PDF.

The QRP is 260 kB in size, no bitmaps or anything else in it, only a few textfields and lines.
It has one page:
test_kl.jpg
The PDF file created by SalReportPrintToFile has a size of about 25 MB (!!) - what is far from any reality.
Printing this PDF again with a PDF printer results in a PDF of 70 kB.

I'm using TD6.0-sp8

We produce a lot of documents, so a filesize of 25MB per document will fill up the customers disk within a few days ...

What can I do? Any hints? Anyone else encountered this problem?

Thanks in advance
Alexander
You do not have the required permissions to view the files attached to this post.

Christof
Germany
Posts: 191
Joined: 06 Mar 2017, 07:27
Location: Frankfurt, Germany

Re: Abnormal filesize when using SalReportPrintToFile() for PDF

Post by Christof » 10 Oct 2016, 07:33

This is due to the embedded fonts in the resulting PDF file. Have a look at SalReportPrintToFileEx where you are able to control font embedding more granular. You probably need to experiment a little with the possible options...

Alexander

Re: Abnormal filesize when using SalReportPrintToFile() for PDF

Post by Alexander » 12 Oct 2016, 20:39

Hi Christof,

thanks for your reply. I was not in office a few days so I saw it just now.

I thought, SalReportPrintToFileEx() only produces RTF and ASCII, but not PDF, because the headline of the help topic says "Prints a report to a file in RTF format or in ASCII text format."
Therefore, I've never read the further details of the help for SalReportPrintToFileEx().
In result of your hint I took a closer look and further down in the help is stated that you can also do a "nFormat = 2" for PDF.
Without your hint I would never had found this :)

Thank you very much, I will give it a try now!
Alexander.

Alexander

Re: Abnormal filesize when using SalReportPrintToFile() for PDF

Post by Alexander » 18 Oct 2016, 13:55

Hi Christof,

using SalReportPrintToFileEx results in a PDF with 35kB - perfect :)

Again many thanks for your help
Alexander

Return to “General Discussion Report Builder”

Who is online

Users browsing this forum: [Ccbot] and 5 guests