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

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

Christofer created PDFBOX-3299:
----------------------------------

             Summary: 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
    Affects Versions: 2.0.0
            Reporter: Christofer


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