Hi,

Am 04.10.2012 02:58, schrieb Nicholas Tiong:
Hi,

I'm new here and I've just discovered PDFBox. My experience with coding is
fairly basic.

Based on a sample code I found here,
http://stackoverflow.com/questions/6831194/how-can-i-remove-all-images-drawi
ngs-from-a-pdf-file-and-leave-text-only-in-java
That code removes only those images which are directly referenced within the resources of a page/document. But those which are part of an other XObject won't be removed.

It seems that it should work for my purpose; that is to remove all images
from a PDF whilst preserving formatting. Basically I plan to print a large
document in black and white on a laser printer without pictures, and then
run it through a colour inkjet for the pictures.

Could anyone help me figure out why the code in the link above does not
work? It creates the 'stripped' file and throws no exceptions but all the
images are still within.

I've found another PDFBox code that extract images and saves it to file
which works for all individual pictures in the document, so I am certain the
PDF is formatted correctly with pictures embedded within it.

Any help would be much appreciated.
I guess it's easier to deactivate the "draw image" operator. Commenting the "Do" line in PageDrawer.properties should do the trick.

Regards,
Nicholas Tiong

BR
Andreas Lehmkühler

Reply via email to