You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by Pontus Hulin <po...@laidbacksolutions.se> on 2010/12/07 10:58:12 UTC
Problems with colors when extracting CMYK images from pdf files.
Hello
I have a problem extracting images from pdf files using the code below.
All images in RGB format look ok, but images in CMYK format does not
look ok. What can I do to fix this problem. Do I need to covert the
image after export or can I du it during export?
Best regards
/ Pontus
ListIterator pages =
pdfDoc.getDocumentCatalog().getAllPages().listIterator();
int i = 0;
while( pages.hasNext() )
{
PDPage page = (PDPage)pages.next();
PDResources resources = page.getResources();
images = resources.getImages();
if( images != null ) {
Iterator imageIter = images.keySet().iterator();
while( imageIter.hasNext() )
{
String key = (String)imageIter.next();
// System.out.println("key:" + key);
PDXObjectImage image = (PDXObjectImage)images.get(
key );
image.write2file( name );
....