Help with PDF compression

Posted by: simona.fratus on 12 January 2024, 2:13 am EST

    • Post Options:
    • Link

    Posted 12 January 2024, 2:13 am EST

    Hi!

    A friend of mine is trying to create accessible PDFs but he noticed that the tagged pdf-ua are a bit too much heavier than the files without accessibility; we obviously expect the accessible files to be a bit heavier due to the tag tree etc but right now they seem a bit too heavy than expected :frowning: we also tryed to use compressionLevel smallestsize but it didn’t fix the problem much.

    Is there something else we can do to to aquire the maximal compression level possible?

    In the attached files you can see the version “AsIs” which is the one without accessibility and the version “ToBe” with the tags and the smallestsize compression level.

    Thank you very much for the help!

    PdfConSfondoCompresso.zip2Pagine.zip

  • Posted 15 January 2024, 10:35 pm EST

    Hello Simona,

    Thank you for looking into our product.

    Can you please share the original pdf on which you have applied the smallestsize compression level so that we can deeply look into this issue?

    Regards,

    Prabhat Sharma.

  • Posted 16 January 2024, 12:21 am EST

    Hi!

    Both the file FILESTAMPA_ToBe and FILESTAMPA_2_ToBe are generated applying also the smallestsize compression level, is there anything wrong with those files?

  • Posted 17 January 2024, 7:05 pm EST

    Hello Simon,

    No, there is no issue with the attached files.

    The SmallestSize compression level that the DsPdf API provides compresses the files to the smallest size possible.

    So we wanted to have the original, accessible PDFs so that we could share them with the development team to get their insights on whether we could compress this file any further.

    Regards,

    Prabhat Sharma.

  • Posted 11 February 2024, 9:50 pm EST

    Hi!

    Sorry for the delayed answer, i saw your reply just a few minutes ago ^^‘’

    Here is the original accessible file without the compression level ^^ let me know if there is something else I need to do ^^ FILESTAMPA20231222125835.zip

  • Posted 20 February 2024, 8:47 pm EST

    Hi!

    Is there any news? Let me know if the zip file is ok or if you need anything else :slight_smile:

    Have a nice day,

    Simona

  • Posted 21 February 2024, 5:35 pm EST

    Hello Simona,

    Apologies for the delay in response.

    The pdf that you have created is using the DsPdf API and I believe you have saved it without applying any compression.

    Can you please share the code that you used to create this pdf? And also, let us know the DsPdf version that you are using at your end.

    Regards,

    Prabhat Sharma.

  • Posted 22 February 2024, 1:16 am EST

    Hi!

    I opened the files priviously shared and I saw that we sent the wrong original file; I share here some new documents to have a more clear situation ^^ FilePDFperPost.zip Inside the zip you can see 2 different document group: 1 with single page documents and the other with 2 pages; inside each folder there are 4 files: 1 is the tagged gc PDF without any compression, 1 is the tagged gc PDF with optimal compression, 1 is the tagged cg document with the smallest size compression and the last one is the untagged old document created using itextsharp ^^ you can see that the untagged itextsharp PDF is smaller then the others and that the gc uncompressed and compressed files have a really similar size ^^

    The versione used initially was the 7.0.1 and then they upgraded it to the 7.0.3 ^
    ^

    Unfortunally I can’t share the full code but we just created the tagged PDF and eventually applyed the compression level :slight_smile:

    Let me know if I can do something else :slight_smile:

    Best regards,

    Simona

  • Posted 22 February 2024, 5:53 pm EST

    Hello Simona,

    All the streams in your given pdfs seem to be already compressed so after applying the compression level, it does not compress the pdf further.

    We can also see that your tagged pdfs are PDF/UA-1 Standard, which is not supported by the DsPdf API so we assume you are setting the conformance level using some other API.

    Please see the list of the PdfAConformanceLevel supported by DsPdf

    https://developer.mescius.com/document-solutions/dot-net-pdf-api/docs/online/DS.Documents.Pdf~GrapeCity.Documents.Pdf.PdfAConformanceLevel.html?highlight=pdfaconformancelevel%2C

    We have tried setting the conformance level to PdfA1a and compression to SmallestSize to the “File_1pagina_Itext.PDF” using the DsPdf API and it gives the following output:

    **

    Single-page PDF:

    Without License: Size: 118 KB

    With License: Size: 15KB

    Two-page PDF:

    Without License: Size: 121 KB

    With License: Size: 18KB

    **

    Please find the files attached for reference.

    So you can see that applying a license can make a huge difference in the size of the compliance level. Please let us know if you need a trial license to test this scenario.

    In case you have any different understanding, please feel free to share.

    Regards,

    Prabhat Sharma.

    ConsoleApp1.zip

  • Posted 6 March 2024, 1:58 am EST

    Hi!

    I made some test too with and without the grapecity license and with and without font embedding and I have a new question :slight_smile: If i create a tagged pdf/a-1a with font embedding and i use the grapecity standardFont.*, is it ok to use those file commercially? Or to to so I have to load the font from a .ttf file with the right font license?

  • Posted 6 March 2024, 3:29 pm EST

    Hello Simona,

    The fonts in StandardFont are common fonts that should be available on every machine. You can use this without loading any .ttf file.

    If you are using any other custom font, then please look at the following links for help:

    https://developer.mescius.com/document-solutions/dot-net-pdf-api/docs/online/Font.html

    https://developer.mescius.com/document-solutions/dot-net-pdf-api/demos/features/fonts

    Regards,

    Prabhat Sharma.

  • Posted 6 March 2024, 7:43 pm EST

    Ok, thank you very very much!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels