xsharp.eu • ReportPro 2.x .NET: PDFs with QR code images are very large
Page 1 of 1

ReportPro 2.x .NET: PDFs with QR code images are very large

Posted: Tue Jul 06, 2021 11:22 am
by Bernhard Mayer
Dear fellow X#'ers!

In our application we are using ReportPro 2.x .NET to create PDFs containing images holding QR codes; unfortunately those PDFs are extremely large.
  • Print ReportPro report with QR code image with FreePDF (= PDF printer) --> PDF size = 27 KB
  • Create PDF with same report/content with ReportPro.Net 2.x --> PDF size > 3 MB
The underlying QR code image file is a PNG with 47 KB. Any ideas what could be done to get the RP reports "smaller" but still with readable QR codes?

BR & TIA
Bernhard

ReportPro 2.x .NET: PDFs with QR code images are very large

Posted: Tue Jul 06, 2021 11:50 am
by HeikoP
Bernhard,

i use Rp3 and bought the for Rp3 sourcecode lately. I´m shure it´s different to Rp2 but the PDF-component will surely be the same. You should have to buy that PDF-component too, to change things. But fortunatly then you could use the actual version of this component. You then will be able to change the compression rate of the PDF´s. I´m not sure how much this effects the size in you case, but i see this as an option to solve you problem.

Greetings

Heiko

ReportPro 2.x .NET: PDFs with QR code images are very large

Posted: Tue Jul 06, 2021 1:08 pm
by robert
Bernhard,
I think the size is due to embedded fonts.
You might want to exclude certain fonts, such as Arial by adding a section to RpWin.ini:

[PDFDoNotEmbed]
Arial=
Arial Bold=
Arial Bold Italic=
Arial Italic=
Times New Roman=
Times New Roman Bold=
Times New Roman Bold Italic=
Times New Roman Italic=
Courier New=
Courier New Bold=
Courier New Bold Italic=
Courier New Italic=
WingDings=

ReportPro 2.x .NET: PDFs with QR code images are very large

Posted: Tue Jul 06, 2021 1:21 pm
by Bernhard Mayer
Hi Robert!

Thanks for your answer; I forgot to mention that without the (47 KB) QR image the size of the PDF is 8 KB, so the fonts are not the problem (I am aware of fonts + RpWin.ini).

Any other ideas? I could provide a sample application demonstrating the problem.

Best regards,
Bernhard

ReportPro 2.x .NET: PDFs with QR code images are very large

Posted: Tue Jul 06, 2021 1:30 pm
by Bernhard Mayer
Hi Heiko,

I already have the ReportPro 2.x .NET source code since 2010 and though I've succeeded in adding some features I do not have the neccessary knowledge to alter the PDF creation on that level.

BR,
Bernhard

ReportPro 2.x .NET: PDFs with QR code images are very large

Posted: Tue Jul 06, 2021 1:45 pm
by robert
Bernhard,
Can mail me (a link to) an example PDF so I can see what the contents of the PDF is and what causes it to grow to 3Mb.

Robert

ReportPro 2.x .NET: PDFs with QR code images are very large

Posted: Tue Jul 06, 2021 3:22 pm
by HeikoP
Bernhard,

have you tried a JPG File instead of a PNG? Is the size difference between ReportPro-PDF and PDF-Free still that big?

Heiko

ReportPro 2.x .NET: PDFs with QR code images are very large

Posted: Tue Jul 06, 2021 3:27 pm
by robert
Heiko,

The problem was that the "Compress" option on the PDF Options dialog was not selected...
With that option selected the file shrunk to 21 Kb.
The QR code is actually just a whole lot of 0x00 and 0xFF characters and can be compressed very well.
The 45 Kb PNG file is lossless compressed ~17Kb in the PDF.

Robert