pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "T. Groch" <t.gr...@gmail.com>
Subject Make the jar smaller?
Date Thu, 25 Nov 2010 07:00:14 GMT
Hi,

I just use PDFbox to edit some PDFs and I have some problems with the
filesize. Is it somehow possible to shrink it? I don't know which files I
can delete.
My own code generally looks like this:

PDDocument doc = PDDocument.load(fileFoo);
List<PDPage> list = doc.getDocumentCatalog().getAllPages();
PDPage page = (PDPage) list.get(0);
PDFont font = PDType1Font.HELVETICA_BOLD;
PDPageContentStream cs = new PDPageContentStream(doc, page, true, true);
cs.setFont(font, 8);
cs.beginText();
cs.moveTextPositionByAmount(140, 754);
cs.drawString("Foo");
cs.endText();
cs.close();
doc.save(sPathToOutputPDF + sPDFFilenamePrefix + sPDFFilenamePostfix +
".pdf");

So, I don't think I use much of PDFbox' capabilities. My program is on a LAN
server, so that all users can access it. And the 10 mb make it really slow.
Thanks in advance.

Best regards,

Tobias

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message