From users-return-10965-archive-asf-public=cust-asf.ponee.io@pdfbox.apache.org Fri Apr 20 06:57:33 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id D81C6180645 for ; Fri, 20 Apr 2018 06:57:32 +0200 (CEST) Received: (qmail 63762 invoked by uid 500); 20 Apr 2018 04:57:31 -0000 Mailing-List: contact users-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@pdfbox.apache.org Delivered-To: mailing list users@pdfbox.apache.org Received: (qmail 63747 invoked by uid 99); 20 Apr 2018 04:57:30 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Apr 2018 04:57:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 628CB1807C0 for ; Fri, 20 Apr 2018 04:57:30 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.971 X-Spam-Level: X-Spam-Status: No, score=0.971 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id faCBLWQXU6uE for ; Fri, 20 Apr 2018 04:57:28 +0000 (UTC) Received: from mailout04.t-online.de (mailout04.t-online.de [194.25.134.18]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 323675F238 for ; Fri, 20 Apr 2018 04:57:28 +0000 (UTC) Received: from fwd29.aul.t-online.de (fwd29.aul.t-online.de [172.20.26.134]) by mailout04.t-online.de (Postfix) with SMTP id 4E8A341B797B for ; Fri, 20 Apr 2018 06:57:27 +0200 (CEST) Received: from [192.168.2.105] (S8XAgiZJrhM-nEMsOuy3eJf8AGLWJsj6RpDj7w66Z+ZZFdNsa3YcPj-MO92i5gRwUS@[217.231.131.219]) by fwd29.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1f9O6v-16tqm80; Fri, 20 Apr 2018 06:57:25 +0200 Subject: Re: Tiff to Pdf exception To: users@pdfbox.apache.org References: From: Tilman Hausherr Message-ID: <809c9ed8-b982-1705-2ce0-0daa89f1618a@t-online.de> Date: Fri, 20 Apr 2018 06:57:23 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-ID: S8XAgiZJrhM-nEMsOuy3eJf8AGLWJsj6RpDj7w66Z+ZZFdNsa3YcPj-MO92i5gRwUS X-TOI-MSGID: e88ce8d2-0f36-43a6-80f5-f17d5ed98f02 The CCITTFactory can be used only for certain TIFF files, i.e. that are packed in the proper way. The solution is to call ImageIO.read() on your file and then use the LosslessFactory with the BufferedImage you get. You may need jar_imageio.jar ( https://github.com/jai-imageio/jai-imageio-core ) or the twelvemonkeys library to be able to read .tif files. This will bring the same result than with CCITTFactory but will be a bit slower, because the CCITTFactory uses the tiff files without decompressing. Tilman Am 20.04.2018 um 01:01 schrieb VikramSrinivasan Venkatakrishnan: > Hello, > > I am trying to convert tiff files to PDF and I get the below exception.I > get the same exception with all the tif files I have tried. > Kindly assist. > > > byte[] pngByteArray = FileUtils.readFileToByteArray(new > File("C:\\CCITT_1.TIF")); > InputStream contentStream = new ByteArrayInputStream(pngByteArray); > PDDocument doc = new PDDocument(); > > PDImageXObject ximage3 = CCITTFactory.createFromByteArray(doc, > pngByteArray); > > > Exception in thread "main" java.io.IOException: FillOrder 2 is not supported > at > org.apache.pdfbox.pdmodel.graphics.image.CCITTFactory.extractFromTiff(CCITTFactory.java:408) > at > org.apache.pdfbox.pdmodel.graphics.image.CCITTFactory.createFromRandomAccessImpl(CCITTFactory.java:261) > at > org.apache.pdfbox.pdmodel.graphics.image.CCITTFactory.createFromByteArray(CCITTFactory.java:133) > at > org.apache.pdfbox.pdmodel.graphics.image.CCITTFactory.createFromByteArray(CCITTFactory.java:109) > > Thanks, > Vikram > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org