Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4025014
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:47:37+00:00 2026-05-20T10:47:37+00:00

I am using Apache Fop 1.0 to create PDF documents. By default it uses

  • 0

I am using Apache Fop 1.0 to create PDF documents. By default it uses the FlateFilter to compress the content. The FOP uses the DeflaterOutputStream DEFAULT_COMPRESSION under the cover. I have not found any possibility to set it to BEST_COMPRESSION.

The pdf contains some barcodes as well generated by Barcode4j 2.1. As I see the generated image is quite huge and I have not found any info how compress it:

<fo:instream-foreign-object height="25pt" width="101pt">
   <barcode:barcode xmlns:barcode="http://barcode4j.krysalis.org/ns" message="xxxxxxxx">
     <barcode:code128>
       <barcode:height>37pt</barcode:height>
       <barcode:module-width>0.9pt</barcode:module-width>
       <barcode:human-readable>
         <barcode:placement>none</barcode:placement>
       </barcode:human-readable>
     </barcode:code128>
   </barcode:barcode>
</fo:instream-foreign-object>

If I generate the PDFs (using flate in fop and using the barcode injections written above), then I could decrease the pdf size with simple winzip by 30 percent.

Is there any way to use a better compression algorithm by my process?
The pdf should be openable in Acrobat Reader, so it is not an option to zip at server side and unzip it on the client side.

I think the barcode4j generated image could be compressed, but I can not see how to do it.

Update1:
The generated barcode seems to be too big. The pdf contains 3 pages and 3 barcodes. The 3 barcode is about the 50% of the whole pdf size.

Thanks

Zoltan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:47:38+00:00Added an answer on May 20, 2026 at 10:47 am

    There is no big difference between the default compression setting and the max. If you know ZLib, you can write some test code to see – probably much less than you expected. The reason that you get 30% smaller in size is that compression is applied on the whole file – in PDF only streams are compressed.

    You can substantially reduce the size by using compressed object streams. FOP does not support it but many tools do. See here if you need more information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using apache fop 1.0 to create some pdfs for customers for one
We are generating pdf using apache's xsl fo engine, namely fop 0.95. We have
I have successfully generated password protected pdf using xsl fo from apache foundation's fop
I'm using XSL-FO (Formatting Objects) in XMLSpy with Apache FOP. When I flow content
I'm generating a PDF using Apache FOP and a XSL-FO stylesheet. In the PDF,
I've been trying to transform my XML documents to PDF through Apache FOP, but
I have an application which generates PDFs. Now I'm using Apache FOP just for
I am using Apache FOP 0.95, and all I want to do is add
Using Apache, it is quite simple to set up a page that uses basic
I am currently using Apache FOP and have a stylesheet (possibly from RenderX) that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.