You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2016/03/31 18:00:27 UTC

[jira] [Commented] (PDFBOX-3299) TIFF-files with FillOrder=2 can't be converted to PDF

    [ https://issues.apache.org/jira/browse/PDFBOX-3299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15220088#comment-15220088 ] 

Tilman Hausherr commented on PDFBOX-3299:
-----------------------------------------

We can't support it, because we don't do the compression ourselves, CCITTFactory just takes the stream from the file. The PDF specification doesn't support fillorder 2. So the bug is that we don't refuse such files, I'll add that.

> TIFF-files with FillOrder=2 can't be converted to PDF
> -----------------------------------------------------
>
>                 Key: PDFBOX-3299
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3299
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.0
>            Reporter: Christofer
>            Assignee: Tilman Hausherr
>
> I have issues with some TIFF-files that has the tag FillOrder=2 resulting in a corrupt PDF when trying to convert them with PDFBox. There's no warning or anything, but the resulting PDF can't be viewed.
> Example code to reproduce:
> {code}
> import org.apache.pdfbox.pdmodel.PDDocument;
> import org.apache.pdfbox.pdmodel.PDPage;
> import org.apache.pdfbox.pdmodel.PDPageContentStream;
> import org.apache.pdfbox.pdmodel.common.PDRectangle;
> import org.apache.pdfbox.pdmodel.graphics.image.CCITTFactory;
> import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;
> import java.io.File;
> import java.io.IOException;
> public class TiffFillOrder {
> 	public static void main(String[] args) throws IOException {
> 		PDDocument document = new PDDocument();
> 		PDImageXObject tif = CCITTFactory.createFromFile(document, new File(args[0]));
> 		PDPage page = new PDPage();
> 		document.addPage(page);
> 		PDPageContentStream content = new PDPageContentStream(document, page, PDPageContentStream.AppendMode.APPEND, true);
> 		content.drawImage(tif, 0, 0, PDRectangle.A4.getWidth(), PDRectangle.A4.getHeight());
> 		content.close();
> 		document.save(new File(args[1]));
> 	}
> }
> {code}
> I can't attach an example since it contains personal information, but found this in another jira-issue that has the same problem: https://issues.apache.org/jira/secure/attachment/12558110/Wing.tif
> It looks like TiffFaxDecoder has support for this, but the value 1 is always sent to the constructor and the tag for fillorder (266) is never parsed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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