Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Algorithmen, Datenstrukturen und Klassendesign (https://www.delphipraxis.net/78-algorithmen-datenstrukturen-und-klassendesign/)
-   -   Delphi FastReports PDF Größe (https://www.delphipraxis.net/214238-fastreports-pdf-groesse.html)

TurboMagic 8. Dez 2023 23:21

FastReports PDF Größe
 
Hallo,

ich arbeite an einem Report. Vor Hinzufügen eines (zur Laufzeit geladenen) Logos
war die erzeugte PDF immer ca. 360-400 KB groß. frxPDFExport.Compressed ist true.

Jetzt habe ich ein TfrxPicture hinzugefügt (3x3 cm), Stretched, KeepAspectRatio.
Dort lade ich eine Datei logo.jpg rein, die hat 500x155 Pixel Auflösung (96 DPI
sagt Window Explorer). Gebe ich den Report mit ansonsten soweit identischen Daten
aus, braucht er ca. 1,2 MB auf der Platte.

Die jpg braucht ca. 22 KB, speichert man das als 24 bit BMP braucht es ca. 224 KB.
Das würde aber nicht die Verdreifachung der PDF Größe erklären.

Hat da irgendwer eine Idee dazu?
Das Ändern von HighQuality der TfrxPicture Komponente machte übrigens keinen Unterschied!

Grüße
TurboMagic

mytbo 9. Dez 2023 00:18

AW: FastReports PDF Größe
 
Zitat:

Zitat von TurboMagic (Beitrag 1530601)
Hat da irgendwer eine Idee dazu?

Kann ich mit FastReport Version 2022.2.10 in einem Beispiel nicht nachvollziehen. Lade mal das JPG Image hier hoch.

Bis bald...
Thomas

TurboMagic 9. Dez 2023 16:24

AW: FastReports PDF Größe
 
Liste der Anhänge anzeigen (Anzahl: 1)
Hallo,

anbei die Grafik.

Und hier der relevante Code mit meinen PDF Einstellungen:

Delphi-Quellcode:
  DMReceipt.frxPDFExport.Compressed     := true;
  DMReceipt.frxPDFExport.PrintOptimized := true;
  DMReceipt.frxPDFExport.OverwritePrompt := true;
  DMReceipt.frxPDFExport.PdfA           := true;
Grüße

TurboMagic

mytbo 9. Dez 2023 20:47

AW: FastReports PDF Größe
 
Zitat:

Zitat von TurboMagic (Beitrag 1530611)
Und hier der relevante Code mit meinen PDF Einstellungen

In meinem Beispiel vergrößert sich die PDF-Datei durch das Einbinden deiner Grafik um ca. 160KB. Welche FastReport Version verwendest du? Versionen kleiner 6 haben keine gute PDF-Export-Funktion. Als Abhilfe konnte man SynPDF mit FastReport verwenden.

Bis bald...
Thomas

TurboMagic 9. Dez 2023 22:40

AW: FastReports PDF Größe
 
Ich benutze die damals in 11.3 über GetIt installierte Embarcadero Edition...
Wie würde das mit SynPDF ggf. aussehen?

mytbo 9. Dez 2023 23:27

AW: FastReports PDF Größe
 
Zitat:

Zitat von TurboMagic (Beitrag 1530619)
Wie würde das mit SynPDF ggf. aussehen?

In der FR3-Datei steht die Version. Informationen zu FastReport mit SynPDF findest du hier folgend.

Bis bald...
Thomas

TurboMagic 10. Dez 2023 13:03

AW: FastReports PDF Größe
 
Hallo,

ich lese in meiner FR3 Datei Version="2022.2.7".
Danke für den Link.

Grüße
TurboMagic

Kas Ob. 10. Dez 2023 13:33

AW: FastReports PDF Größe
 
Liste der Anhänge anzeigen (Anzahl: 1)
Hi,

I wish i could be more precise about this, but my memory is failing me here.

See, PDF format is complex yet the the structure is very simple, and you can build a parser for it in minutes, but the details for these objects are hard and very complex to parse and handle, sound silly, yes it is, but i think the best approach for such cases which will give you deeper understanding for the PDF, by not reading the format specification itself but by using any already parser there, and here my memory failure, i used a software few years back and couldn't find it or even remember its name or location on my disks !!! shame :oops:

Anyway if you visit https://en.wikipedia.org/wiki/List_of_PDF_software there is punch of software (none reminded me too), and there is one from that list https://blog.didierstevens.com/programs/pdf-tools/ , here an example what parsing the objects should like with GUI from that page
Anhang 56491

You can see the objects and paths ...., and their sizes !

There is in the Wikipedia page and punch of other software that can help you detect what have changed and in what size each.

Hope that isn't wasting you time but give some insight.

PS: i didn't used PDF parsing or handling in Delphi, except i added PDF Signature verification using SecureBlackBox with my own custom simplified PAdES as my license didn't cover that part, yet i can't find that project folder and the accessories tools with it on my drives, (may be i am losing it), anyway, i think there is an existing Delphi/Pascal libraries that will help you do what that parser/analyzer does, it is essential to add objects right, i mean getting list of the PDF objects, so if it is for me i would start with SynPDF and see what it offer in the matter of getting the PDF internal objects and their sizes.

Kas Ob. 10. Dez 2023 13:37

AW: FastReports PDF Größe
 
I forgot one thing, (damm't :wall: ), the image could be encoded or handled as readable string or an equivalent, simply and wrongfully went through few encoding process causing this size increase, as PDF specifications allow such stream encapsulation, so binary converted into base64 then binary again then base64 again !

mytbo 10. Dez 2023 14:13

AW: FastReports PDF Größe
 
Zitat:

Zitat von TurboMagic (Beitrag 1530626)
ich lese in meiner FR3 Datei Version="2022.2.7".

In dieser Version ist ein ordentlicher PDF-Export vorhanden. Im Quelltext-Verzeichnis ist die alte Version der Unit unter dem Namen frxExportPDF_old noch zu finden. Die Umsetzung im neuen umfasst ca. 220KB, die alte Version wurde mit ca. 15KB realisiert. Was in der Embarcadero Edition zum Einsatz kommt, ist mir nicht bekannt. Du kannst aber einen PDF-Editor, z.B. FlexiPDF oder PDF-XChange, nehmen und selbst nachschauen. Die Unterschiede sind nicht zu übersehen.

Bis bald...
Thomas


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:04 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz