pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Strange file problem with CCITTFactory.createFromFile with tiff files with 'FillOrder=2'
Date Wed, 22 Jun 2016 15:38:38 GMT
Am 22.06.2016 um 17:03 schrieb Stahle, Patrick:
> Hi All,
>
> I am using the latest PDFBox 2.0.2 version.
>
> When I attempt to convert a Tiff file that so happens to have 'FillOrder=2' with the
following command:
> DImageXObject ximage = CCITTFactory.createFromFile(document, tiffIn, pdfPageNum);
>
> It throws the Exception:
>                  'FillOrder 2 is not supported'
>
> Which I may not like, but I understand why that is the case.
>
> But I am also seeing the source tiff file is also getting corrupted and is no longer
good tiff file.
>
> As an example:
>
> File listing before command above run -               '-rwxrwxr-x. 1 us083485 us083485
229K Jun 22 10:32 ENG_CR_1418637-DBAG_A5.tif'
> File listing after above command has run-             '-rwxrwxr-x. 1 us083485 us083485
230K Jun 22 10:42 ENG_CR_1418637-DBAG_A5.tif'
>
> Is this a bug, or am I doing something wrong?

That would be terrible if we'd be at fault, but here's the source code:

     public static PDImageXObject createFromFile(PDDocument document, 
File file, int number)
             throws IOException
     {
         return createFromRandomAccessImpl(document, new 
RandomAccessFile(file, "r"), number);
     }

     public RandomAccessFile(File file, String mode) throws 
FileNotFoundException
     {
         ras = new java.io.RandomAccessFile(file, mode);
     }

so the file is opened for reading only.

It would be interesting to have a look what's in your file. Please 
create a copy and then compare it with a good hex editor.

Tilman



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message