Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As an alternative, you could try doing this server-side:<br></p> <p><strong>Approach 1:</strong><br> Convert the PDF files to raster images using an external application and print that instead.<br></p> <p><strong>Approach 2:</strong><br> Adjust your PDF files by recompressing JBIG2 images:<br><br> 1- Extracting the images compressed as JBIG2 from your files.<br><br> 2- Re-compress them with some other algorithm (jpeg, png, etc). In order to do this you might need to go outside of Java using either JNI or <a href="https://stackoverflow.com/a/5604756/501196">calling an external application</a>. You can try with <a href="http://jbig2dec.sourceforge.net/" rel="nofollow noreferrer">jbig2dec</a> or ImageMagic for example if the GPL lincense suits your needs.<br><br> 3- Put the recompressed images back in your PDF.<br> <br><br> This approach will imply some quality loss on those images, but at least you will be able to print the files.</p> <p>You can do this in Java with iText, there is a <a href="http://www.itextpdf.com/examples/iia.php?id=286" rel="nofollow noreferrer">chapter about resizing images in the book iText in Action</a> (with sample code). The idea there is to extract the image, resize it (including recompression) and put it back. You can use this as starting point. Be aware that iText is an AGPL project, hence you cannot use it for free in commercial closed-source applications.</p> <p>If you are using a Windows-based server and you can afford a commercial tool, you can also achieve this with <a href="http://www.amyuni.com/en/developer/pdfcreator/features/" rel="nofollow noreferrer">Amyuni PDF Creator</a> either with C#/VB.Net or C++ (<em>Usual disclaimer applies for this suggestion</em>). You just need to go though all objects of type <a href="http://www.amyuni.com/WebHelp/Amyuni_PDF_Creator_for_NET/Object_Attributes/Drawing_Objects_Attributes/Common_Attributes.htm" rel="nofollow noreferrer">acObjectTypePicture</a> and <a href="http://www.amyuni.com/WebHelp/Amyuni_PDF_Creator_for_NET/Object_Attributes/Drawing_Objects_Attributes/Picture_Object_Attributes.htm" rel="nofollow noreferrer">set the attribute Compression to acJPegHigh</a>, this approach does not require any external JBIG2 decoder, (I can include some sample code here if you are interested). </p> <p>If you are using an applet just to print your PDF files, you could also try <a href="https://stackoverflow.com/questions/6167995/generate-a-pdf-that-automatically-prints">generating a PDF file that shows the print dialog when opened</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload