From dhernandez@example.net Wed Jun 1 11:12:12 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id CEC376784 for <dhernandez@example.net>; Wed, 1 Jun 2011 11:12:12 +0000 (UTC) Received: (qmail 19632 invoked by uid 500); 1 Jun 2011 11:12:12 -0000 Delivered-To: dhernandez@example.net Received: (qmail 19589 invoked by uid 500); 1 Jun 2011 11:12:12 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Delivered-To: moderator for dhernandez@example.net Received: (qmail 77401 invoked by uid 99); 1 Jun 2011 10:36:10 -0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=O5dit4sMeo4Ruk2/6A+WC2kyB5VZPKvkROeXPJ5v+og=; b=BrkDyGLjbaf7uyG+7hPWxegw4UngpfaqTnDwE3PlrxBwaJo+Mjc5c842K5X0FZt6xG CS57g0XGBiT22PXK07x07qxcag+k9X9aHTYnzs5wHU7TWo5vubK95OSI3DjVOJfJwXSU 6lu3VAFf/3aWjmg00sjiSW33rkEQJe2nTJ1HM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=SlGbdTa+cFwgxBaWRE+ixbhlOuEPoo1jlPpMrMoxACzlAuhfnYmG6bpylLo1ZjLmM8 jKbQNtLzC6l+vWrgC8BJln34SPthchClhnQW/PxTWPwykQD3hhOO5Qm7UXuVXy/VpJo8 WPQWX2q2Q+ARPsn6Hjo1KX7z0PaazI17m59KU= MIME-Version: 1.0 Date: Wed, 1 Jun 2011 12:35:41 +0200 Message-ID: <dhernandez@example.net> Subject: Problem with the styles of a pdf form From: Rosa Lago <dhernandez@example.net> To: dhernandez@example.net Content-Type: multipart/alternative; boundary=bcaec548a9210df60104a4a4154a X-Virus-Checked: Checked by ClamAV on apache.org --bcaec548a9210df60104a4a4154a Content-Type: text/plain; charset=ISO-8859-1 Hello, I have created a pdf file using acrobat pro. This file have a form with several text fields which I full using the pdfbox. It works fine but the styles of the fields are loosed, I mean the size and the letter type is different from the ones in the original file. How can I set the format of a text field (PDVariableText) using the pdfbox library? Thanks in advance, Rosa. --bcaec548a9210df60104a4a4154a-- From dhernandez@example.net Wed Jun 1 23:50:41 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id 65DE16907 for <dhernandez@example.net>; Wed, 1 Jun 2011 23:50:41 +0000 (UTC) Received: (qmail 21327 invoked by uid 500); 1 Jun 2011 23:50:41 -0000 Delivered-To: dhernandez@example.net Received: (qmail 21298 invoked by uid 500); 1 Jun 2011 23:50:41 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 21290 invoked by uid 99); 1 Jun 2011 23:50:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Jun 2011 23:50:41 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-pv0-f176.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Jun 2011 23:50:34 +0000 Received: by pve37 with SMTP id 37so194461pve.21 for <dhernandez@example.net>; Wed, 01 Jun 2011 16:50:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=zd4pC+1crtkfXPinIiBJry8gc4cxVXBl9aiOWiXD+Do=; b=I8nbqL46lVknW3T0aAn9mfUi5ike25CmzdnICJmRNlvTX1Tsq37nRXTKanIlm46Cda YhWA/ru83bfkAYsXSyGP6KLPpV9Q82ILg9OG1foG0A6OMa4lt+ZidJ1IT6DyP5M+dQR9 8VbYTDQlvjD0duRc6pMn/t3Zfq1qVICOTXl0M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=IxdnO2rMHQHkvifUvzbEcewxY5VOmvZRJ9fwQFMJJggoi5hyC4hBIYseQIYq/qPtti V+Skdb8KT5KL+8eGdQwEJXiQ4+FOe+eG9ATHHA+DnQbr3c7Op/s8B5AFZaBmQxv/55am 3Tio5Wq5d52xoHTZzkvmGeaqhReY3s6dbC7C8= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id f9mr22347pbf.464.1306972214369; Wed, 01 Jun 2011 16:50:14 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Wed, 1 Jun 2011 16:50:14 -0700 (PDT) Date: Wed, 1 Jun 2011 16:50:14 -0700 Message-ID: <dhernandez@example.net> Subject: Error when extracting PDF From: Mohit Anchlia <dhernandez@example.net> To: dhernandez@example.net Content-Type: text/plain; charset=ISO-8859-1 I am using Apache Tika .8 and tried .9 which is using pdfbox 1.4. It's throwing this error: Caused by: java.lang.NumberFormatException: For input string: "0/NUL" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:458) at java.lang.Integer.parseInt(Integer.java:499) at org.apache.pdfbox.pdmodel.font.PDFont.getEncodingFromFont(PDFont.java:830) at org.apache.pdfbox.pdmodel.font.PDFont.determineEncoding(PDFont.java:293) at org.apache.pdfbox.pdmodel.font.PDFont.&lt;init&gt;(PDFont.java:178) at org.apache.pdfbox.pdmodel.font.PDSimpleFont.&lt;init&gt;(PDSimpleFont.java:79) at org.apache.pdfbox.pdmodel.font.PDType1Font.&lt;init&gt;(PDType1Font.java:139) at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:109) at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:76) at org.apache.pdfbox.pdmodel.PDResources.getFonts(PDResources.java:115) at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:243) at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:225) at org.apache.pdfbox.util.PDFTextStripper.processPage(PDFTextStripper.java:441) at org.apache.pdfbox.util.PDFTextStripper.processPages(PDFTextStripper.java:365) at org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:321) at org.apache.tika.parser.pdf.PDF2XHTML.process(PDF2XHTML.java:56) at org.apache.tika.parser.pdf.PDFParser.parse(PDFParser.java:89) at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:197) ... 26 more So For the same doc I tried command line: java -jar pdfbox-app-1.4.0.jar ExtractText -console and that works. So I am not sure why one works and not the other and how to resolve this issue. From dhernandez@example.net Thu Jun 2 03:36:21 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id 404384640 for <dhernandez@example.net>; Thu, 2 Jun 2011 03:36:21 +0000 (UTC) Received: (qmail 38286 invoked by uid 500); 2 Jun 2011 03:36:20 -0000 Delivered-To: dhernandez@example.net Received: (qmail 38232 invoked by uid 500); 2 Jun 2011 03:36:17 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 38224 invoked by uid 99); 2 Jun 2011 03:36:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jun 2011 03:36:15 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-ww0-f46.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jun 2011 03:36:07 +0000 Received: by wwb28 with SMTP id 28so477222wwb.15 for <dhernandez@example.net>; Wed, 01 Jun 2011 20:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:from:to:references:in-reply-to :subject:date:mime-version:content-type:content-transfer-encoding :x-priority:x-msmail-priority:importance:x-mailer:x-mimeole; bh=90Wb7se/hVuhbwlP7SBwM2Kd3G1+aYJ9Gd4YNqh/iIc=; b=KVo4ANJ7Cst1zCnWTuql453hJbv3Ye4sKnByNJmbXxeArZx7Clcvy1VN5/bm6P+uGc xlfyG6L2LPn85HjaieI3KN0RcLVdQahYePTW9qOs/8GxVdnJU/AdAkoquOYsV57rGIIG /+uTcDPGWY8Ybcsi7iX+C1q4yIj3/ylWuxPq4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:references:in-reply-to:subject:date:mime-version :content-type:content-transfer-encoding:x-priority:x-msmail-priority :importance:x-mailer:x-mimeole; b=Z2HGjz6AfiwnQA8pxt88Nuc8HLyLWnyjv9YxUcEgccr0kERmN282EN9oXVPwvYSr5m vvCPhZ0OkWQkLjOyh+kcJHKJnVMf00JLBmXI6HtWOvPHHaZ8Je+fE3UKq+KQL33DlFcf 4k1Dmt7ZcbgzK6wLeddZrJ/UEw3wzqK4RE6xc= Received: by 83.161.120.155 with SMTP id q1mr188790wby.101.1306985746247; Wed, 01 Jun 2011 20:35:46 -0700 (PDT) Received: from your2f73f42422 ([83.161.120.155]) by mx.google.com with ESMTPS id m8sm107301wbh.62.283.161.120.155.35.41 (version=SSLv3 cipher=OTHER); Wed, 01 Jun 2011 20:35:44 -0700 (PDT) Message-ID: <C5FFCD77185F4CD78BC85C6126AAA9DB@your2f73f42422> From: "Hesham G." <dhernandez@example.net> To: <dhernandez@example.net> References: <dhernandez@example.net> In-Reply-To: <dhernandez@example.net> Subject: Re: Error when extracting PDF Date: Thu, 2 Jun 2011 05:35:48 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8117.416 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416 Mohit , This is out of scope of your question, but I hope you can explain to me what Tika does exactly ? I have read its description and it is useful in text extraction, but I still do not understand what additions does it give ? Why don't you directly use PDFBox ? Best regards , Hesham --------------------------------------------- Included message : > I am using Apache Tika .8 and tried .9 which is using pdfbox 1.4. It's > throwing this error: > > Caused by: java.lang.NumberFormatException: For input string: "0/NUL" > at > java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) > at java.lang.Integer.parseInt(Integer.java:458) > at java.lang.Integer.parseInt(Integer.java:499) > at > org.apache.pdfbox.pdmodel.font.PDFont.getEncodingFromFont(PDFont.java:830) > at > org.apache.pdfbox.pdmodel.font.PDFont.determineEncoding(PDFont.java:293) > at > org.apache.pdfbox.pdmodel.font.PDFont.&lt;init&gt;(PDFont.java:178) > at > org.apache.pdfbox.pdmodel.font.PDSimpleFont.&lt;init&gt;(PDSimpleFont.java:79) > at > org.apache.pdfbox.pdmodel.font.PDType1Font.&lt;init&gt;(PDType1Font.java:139) > at > org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:109) > at > org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:76) > at > org.apache.pdfbox.pdmodel.PDResources.getFonts(PDResources.java:115) > at > org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:243) > at > org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:225) > at > org.apache.pdfbox.util.PDFTextStripper.processPage(PDFTextStripper.java:441) > at > org.apache.pdfbox.util.PDFTextStripper.processPages(PDFTextStripper.java:365) > at > org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:321) > at org.apache.tika.parser.pdf.PDF2XHTML.process(PDF2XHTML.java:56) > at org.apache.tika.parser.pdf.PDFParser.parse(PDFParser.java:89) > at > org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:197) > ... 26 more > > So For the same doc I tried command line: > > java -jar pdfbox-app-1.4.0.jar ExtractText -console > > and that works. So I am not sure why one works and not the other and > how to resolve this issue. > From dhernandez@example.net Fri Jun 3 08:43:53 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id 77AFB6F8D for <dhernandez@example.net>; Fri, 3 Jun 2011 08:43:53 +0000 (UTC) Received: (qmail 93438 invoked by uid 500); 3 Jun 2011 08:43:53 -0000 Delivered-To: dhernandez@example.net Received: (qmail 93412 invoked by uid 500); 3 Jun 2011 08:43:53 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 93403 invoked by uid 99); 3 Jun 2011 08:43:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 08:43:52 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO snt0-omc1-s28.snt0.hotmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 08:43:43 +0000 Received: from SNT129-DS4 ([83.161.120.155]) by snt0-omc1-s28.snt0.hotmail.com with Microsoft SMTPSVC(787)315-1865); Fri, 3 Jun 2011 01:43:22 -0700 X-Originating-IP: [83.161.120.155] X-Originating-Email: [dhernandez@example.net] Message-ID: <dhernandez@example.net> From: "Tiaan Pat" <dhernandez@example.net> To: <dhernandez@example.net> Subject: PDFBOX 1.5 dll's Date: Fri, 3 Jun 2011 10:43:19 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_08C7_01CC21DB.0DCD3B10" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3508.1109 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3508.1109 X-OriginalArrivalTime: 03 Jun 2011 08:43:22.0370 (UTC) FILETIME=[4BADE620:01CC21CA] X-Virus-Checked: Checked by ClamAV on apache.org ------=_NextPart_000_08C7_01CC21DB.0DCD3B10 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi=20 I am trying to use pdfbox and I have a few problems in getting it to = work in .net. I tried using pdfbox 0.7.3 and I get this error =E2=80=9CThe type = initializer for 'gnu.java.util.regex.RESyntax' threw an = exception.=E2=80=9D I cant seem to figure out why its giving this error. I then tried to get = the latest version 1.5 but I cant manage to get the dll=E2=80=99s from = the java. Is there anyone that can please help me with this or guide me in the = right direction. There isn=E2=80=99t a lot of data on the internet or I = am just not looking=20 in the right place.=20 Your help would be much appreciated. Regards Tiaan dhernandez@example.net ------=_NextPart_000_08C7_01CC21DB.0DCD3B10-- From dhernandez@example.net Fri Jun 3 17:54:45 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id 801AF6B17 for <dhernandez@example.net>; Fri, 3 Jun 2011 17:54:45 +0000 (UTC) Received: (qmail 44867 invoked by uid 500); 3 Jun 2011 17:54:45 -0000 Delivered-To: dhernandez@example.net Received: (qmail 44851 invoked by uid 500); 3 Jun 2011 17:54:45 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 44843 invoked by uid 99); 3 Jun 2011 17:54:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 17:54:45 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-vw0-f48.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 17:54:38 +0000 Received: by vws7 with SMTP id 7so2268546vws.21 for <dhernandez@example.net>; Fri, 03 Jun 2011 10:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=oeE1wD7n99uwTsk8mYS+KnvTMl9xv8H8H5Miccqrrcs=; b=f5pZDCm817c7xcSvz+/v5b51cbhVAVsT8gxtXUKdNLkv4TvEF4Tv7b+R8K/fcYxytr GHzVeVGzdgYtUD//QAxRQqUnCWTW4dyBH4w5OvNbMIt3tI2APWuylwuLvMA32FdJqcuq FZsEXt3POl3BCQ9r2AY+083jZGh/xHLo/7kf0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=bLTS3f/1B2TL2LQnLOSt2JNl3jKtnvGQ/zusuzfbo6dwqwYXgxJgEli1AecIl3WFeo dXPjY16YCYdD86lsS6MtfeP/3ls5LtQChFSFDX+y4vh98PIx8+lmOXLZEFEm58EAie2q 2NOrZ0wkMvD4oqpdgOJ0hO9ilHGgCnjRmcOao= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id fl6mr2986574vdc.53.1307123658077; Fri, 03 Jun 2011 10:54:18 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Fri, 3 Jun 2011 10:54:18 -0700 (PDT) Date: Fri, 3 Jun 2011 19:54:18 +0200 Message-ID: <dhernandez@example.net> Subject: I want to change the style of a PDVariableText From: Rosa Lago <dhernandez@example.net> To: dhernandez@example.net Content-Type: multipart/alternative; boundary=bcaec548ab1951371004a4d2718b --bcaec548ab1951371004a4d2718b Content-Type: text/plain; charset=ISO-8859-1 Hello, I have a pdf form whith several multiline text fields. When I set the values of these fields using the setValue method, the pdf file changes the style of them and it shows an enormous letters inside them. I want to fix the size of the text of these fields using the setAppearanceValue method of the PDAppearance class, but I don know how to format the string parameter that it needs. Can anybody help me? Is it there another form of control the size of these fields? Do somebody know how to format that string parameter? Thanks in advance, Rosa Lg.* * --bcaec548ab1951371004a4d2718b-- From dhernandez@example.net Sat Jun 4 14:31:57 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id 0A7774CE3 for <dhernandez@example.net>; Sat, 4 Jun 2011 14:31:57 +0000 (UTC) Received: (qmail 77453 invoked by uid 500); 4 Jun 2011 14:31:56 -0000 Delivered-To: dhernandez@example.net Received: (qmail 77414 invoked by uid 500); 4 Jun 2011 14:31:56 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 77406 invoked by uid 99); 4 Jun 2011 14:31:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Jun 2011 14:31:55 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-wy0-f176.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Jun 2011 14:31:49 +0000 Received: by wyb40 with SMTP id 40so2905485wyb.21 for <dhernandez@example.net>; Sat, 04 Jun 2011 07:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:from:to:subject:date:mime-version :content-type:x-priority:x-msmail-priority:importance:x-mailer :x-mimeole; bh=LCL8XwOz/e82oiCuHg7VeN5ELWuY6uPHY5BpRJ9UT+o=; b=v98GBePIxJ7+DoYS6jKBYvFxhGIM90ckhZKdabT+sy5WTE9QCJ1guEZ4qo6jKqlAYW aiNUCuWheIxT/Dj06R/X3UjOlzstQ6tX6OZ1ugAYAAU8HHaNY0eUepDF/t3ATBs8bTFA KK5yx9vooQZQTuNnTj5EO4bRrPnvFkKWdEYfw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:subject:date:mime-version:content-type :x-priority:x-msmail-priority:importance:x-mailer:x-mimeole; b=U3VKaX1Z59KyXcXtp/o6Shvba/pBJgwl8pU0WcQCwA8QZc6vUgYZCtJBgdoiOUqPJX TLDREearRuTiKSx9EU35qt2HLC73ItJJnNLl9qKxC4IWd7t6yY/P2LwdjeJ833IrtxVk 8a6NaEw2DgQJapO36EuvZAjGx3oRtfnc+N2eA= Received: by 83.161.120.155 with SMTP id en16mr3139081wbb.58.1307197887886; Sat, 04 Jun 2011 07:31:27 -0700 (PDT) Received: from your2f73f42422 ([83.161.120.155]) by mx.google.com with ESMTPS id e1sm1678712wbh.5.283.161.120.155.31.26 (version=SSLv3 cipher=OTHER); Sat, 04 Jun 2011 07:31:27 -0700 (PDT) Message-ID: <21ED07C5B10649DEB1677934C2226DA9@your2f73f42422> From: "Hesham G." <dhernandez@example.net> To: "pdfbox-send-question" <dhernandez@example.net> Subject: My pdf can't be loaded by PDFBox Date: Sat, 4 Jun 2011 16:31:30 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_028F_01CC22D4.DC339180" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8117.416 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416 ------=_NextPart_000_028F_01CC22D4.DC339180 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello , I have a PDF that when I try to load using PDFBox 1.5, the following = error is thrown : WARN - Bad Dictionary Declaration = org.apache.pdfbox.io.PushBackInputStream@16a4a67 You can download the PDF to test it from here: = http://www.4shared.com/document/9ICxOhZW/Dont_make_me_think.html Can somebody please check it ? Best regards , Hesham ------=_NextPart_000_028F_01CC22D4.DC339180-- From dhernandez@example.net Sat Jun 4 17:57:20 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id C83C3471C for <dhernandez@example.net>; Sat, 4 Jun 2011 17:57:20 +0000 (UTC) Received: (qmail 77636 invoked by uid 500); 4 Jun 2011 17:57:20 -0000 Delivered-To: dhernandez@example.net Received: (qmail 77616 invoked by uid 500); 4 Jun 2011 17:57:20 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 77608 invoked by uid 99); 4 Jun 2011 17:57:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Jun 2011 17:57:20 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mailout-de.gmx.net) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 04 Jun 2011 17:57:14 +0000 Received: (qmail invoked by alias); 04 Jun 2011 17:56:52 -0000 Received: from p4FC5C870.dip.t-dialin.net (EHLO AndreyPC) [83.161.120.155] by mail.gmx.net (mp053) with SMTP; 04 Jun 2011 19:56:52 +0200 X-Authenticated: #2350593 X-Provags-ID: V01U2FsdGVkX1++Pe9dEx6+hfy7CoCIT3a8BV4KDuU/Dvd5mI097A Qa2cjMtCLnHawx From: "Andrey Kuznetsov" <dhernandez@example.net> To: <dhernandez@example.net> References: <21ED07C5B10649DEB1677934C2226DA9@your2f73f42422> In-Reply-To: <21ED07C5B10649DEB1677934C2226DA9@your2f73f42422> Subject: AW: My pdf can't be loaded by PDFBox Date: Sat, 4 Jun 2011 19:57:00 +0200 Message-ID: <01ae01cc22e0$cd9e15d0$68da4170$@de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcwixCn4YBcQ9DcxQUuP/jQ0PJQmlAAG/f8A Content-Language: de X-Y-GMX-Trusted: 0 Hesham, Probably PdfBox can't handle Cross-Reference Streams. Andrey -----Urspr=FCngliche Nachricht----- Von: Hesham G. [mailto:dhernandez@example.net]=20 Gesendet: Samstag, 4. Juni 2011 16:32 An: pdfbox-send-question Betreff: My pdf can't be loaded by PDFBox Hello , I have a PDF that when I try to load using PDFBox 1.5, the following = error is thrown : WARN - Bad Dictionary Declaration org.apache.pdfbox.io.PushBackInputStream@16a4a67 You can download the PDF to test it from here: http://www.4shared.com/document/9ICxOhZW/Dont_make_me_think.html Can somebody please check it ? Best regards , Hesham From dhernandez@example.net Sun Jun 5 03:02:00 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id 16CCC68DB for <dhernandez@example.net>; Sun, 5 Jun 2011 03:02:00 +0000 (UTC) Received: (qmail 39147 invoked by uid 500); 5 Jun 2011 03:01:59 -0000 Delivered-To: dhernandez@example.net Received: (qmail 39127 invoked by uid 500); 5 Jun 2011 03:01:58 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 39119 invoked by uid 99); 5 Jun 2011 03:01:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Jun 2011 03:01:57 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-wy0-f176.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Jun 2011 03:01:51 +0000 Received: by wyb40 with SMTP id 40so3161746wyb.21 for <dhernandez@example.net>; Sat, 04 Jun 2011 20:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:from:to:references:in-reply-to :subject:date:mime-version:content-type:content-transfer-encoding :x-priority:x-msmail-priority:importance:x-mailer:x-mimeole; bh=ebKMuKG5KzDkzuSdyuiF+cHACD0dM77xqcPxrTcfWrM=; b=Bg+5+5L958qfsTPGevS7voSefTIMI1HyJIOHGCKEiCwaI2DYSMutGpyWL0ZXRYmZst vX+aCq7yeY2E4+ZyjMRBoGjwDfmwYzYNcflheMGuS4LMn/ra39OgpF7iOHn/wUmQ8h0s XebNHirnfE3gb86SJ1atl/YrueawjlirZ3nbw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:references:in-reply-to:subject:date:mime-version :content-type:content-transfer-encoding:x-priority:x-msmail-priority :importance:x-mailer:x-mimeole; b=Qouj3tonTdY3DKXjVTgmZpSYuqckN0g0V/Mf7CO5DVNNP7FVUUUYDLT4+O2j7Q+vqy 2/iZc4XRDw7Aa6AbJeiwP8OrYYa+6IO/RFPtt49F3nhYRR82HNvNyaxbCkRcqRksnGtC vWxHMIKlbK89gkrytDaNFiq8hk7/Bh8w/novQ= Received: by 83.161.120.155 with SMTP id u20mr3497078wbw.7.1307242889727; Sat, 04 Jun 2011 20:01:29 -0700 (PDT) Received: from your2f73f42422 ([83.161.120.155]) by mx.google.com with ESMTPS id b10sm1972872wbh.60.283.161.120.155.01.25 (version=SSLv3 cipher=OTHER); Sat, 04 Jun 2011 20:01:28 -0700 (PDT) Message-ID: <EDCF01A0082E4347A146AA0F59BCC83D@your2f73f42422> From: "Hesham G." <dhernandez@example.net> To: <dhernandez@example.net> References: <21ED07C5B10649DEB1677934C2226DA9@your2f73f42422> <01ae01cc22e0$cd9e15d0$68da4170$@de> In-Reply-To: <01ae01cc22e0$cd9e15d0$68da4170$@de> Subject: Re: AW: My pdf can't be loaded by PDFBox Date: Sun, 5 Jun 2011 05:01:34 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8117.416 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416 Andrey , Thanks for the information ... I have read now some info. about the Cross-Reference Streams. I guess this should be supported sooner or later in PDFBox. It seems to be widely used. Best regards , Hesham --------------------------------------------- Included message : > Hesham, > > Probably PdfBox can't handle Cross-Reference Streams. > > Andrey > > > -----Ursprüngliche Nachricht----- > Von: Hesham G. [mailto:dhernandez@example.net] > Gesendet: Samstag, 4. Juni 2011 16:32 > An: pdfbox-send-question > Betreff: My pdf can't be loaded by PDFBox > > Hello , > > I have a PDF that when I try to load using PDFBox 1.5, the following error > is thrown : > WARN - Bad Dictionary Declaration > org.apache.pdfbox.io.PushBackInputStream@16a4a67 > > > You can download the PDF to test it from here: > http://www.4shared.com/document/9ICxOhZW/Dont_make_me_think.html > Can somebody please check it ? > > Best regards , > Hesham > > From dhernandez@example.net Mon Jun 6 03:50:08 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id 627334B25 for <dhernandez@example.net>; Mon, 6 Jun 2011 03:50:08 +0000 (UTC) Received: (qmail 44052 invoked by uid 500); 6 Jun 2011 03:50:07 -0000 Delivered-To: dhernandez@example.net Received: (qmail 43822 invoked by uid 500); 6 Jun 2011 03:49:56 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 43782 invoked by uid 99); 6 Jun 2011 03:49:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jun 2011 03:49:53 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-gx0-f176.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jun 2011 03:49:47 +0000 Received: by gxk7 with SMTP id 7so1784404gxk.21 for <dhernandez@example.net>; Sun, 05 Jun 2011 20:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=P0e6IIpTXs+L1UcnDQZoIYZ2l/AbiONoRugLIEnhJVo=; b=ZZzuXlfIF5EV7nD0bedEhggbz7z5hwPVgEp/PBKpP7XTXCjLTrwEUm1wLr+NeR3H4R n2aL3FPx3pEEwAQ22uMMgBYZE8RMF5Lke66iOkiX3SBNPNKmRRmIUkmfQLm5q4Db5/4Z KDcoPcenmSNdCD0yaQdU8ZyUbeddPLCkhfIM8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=f9k6jJ4VdxzUn0c09Go3oCAHG9dlZSldMTh/0zZEB58RT0KvhgrfALgaalmFSreLHz lC8qPOqqxmdKl0duYvNhpSMoC52QwoNAM+wmzKNsiyKJWYkMpgFlKoVcFyZAUt204Rar aJ6/bVJ/ksomok6x3j4jLcI2tssskALza2vgQ= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id s10mr4098629ybe.76.1307332165352; Sun, 05 Jun 2011 20:49:25 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Sun, 5 Jun 2011 20:49:25 -0700 (PDT) In-Reply-To: <dhernandez@example.net> References: <dhernandez@example.net> Date: Sun, 5 Jun 2011 23:49:25 -0400 Message-ID: <dhernandez@example.net> Subject: Re: PDFBOX 1.5 dll's From: Bill Burns <dhernandez@example.net> To: dhernandez@example.net Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Jun 3, 2011 at 4:43 AM, Tiaan Pat <dhernandez@example.net> wrote: > Hi > > I am trying to use pdfbox and I have a few problems in getting it to work= in .net. > I tried using pdfbox 0.7.3 and I get this error =93The type initializer f= or 'gnu.java.util.regex.RESyntax' threw an exception.=94 > I cant seem to figure out why its giving this error. I then tried to get = the latest version 1.5 but I cant manage to get the dll=92s from the java. > > Is there anyone that can please help me with this or guide me in the righ= t direction. There isn=92t a lot of data on the internet or I am just not l= ooking > in the right place. > > Your help would be much appreciated. > > Regards > Tiaan 1. Here's the software versions I have installed: C:\Documents and Settings\bill>ant -version Apache Ant(TM) version 1.8.2 compiled on December 20 2010 C:\Documents and Settings\bill>mvn -version Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500) Maven home: C:\Program Files\Apache Software Foundation\apache-maven-3.0.3 Java version: 1.6.0_25, vendor: Sun Microsystems Inc. Java home: C:\Program Files\Java\jdk1.6.0_25\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows xp", version: "5.1", arch: "x86", family: "windows" C:\Documents and Settings\bill>ikvm -version IKVM.NET Launcher version 83.161.120.155 Copyright (C) 2002-2011 Jeroen Frijters http://www.ikvm.net/ CLR version: 2.0.50727.3620 (32 bit) mscorlib: 83.161.120.155 ikvm: 83.161.120.155 System: 83.161.120.155 IKVM.OpenJDK.Core: 83.161.120.155 IKVM.Runtime: 83.161.120.155 System.Configuration: 83.161.120.155 System.Xml: 83.161.120.155 OpenJDK version: OpenJDK 6 b22 2. I have of the above installed per their instructions (see individual web sites) and the appropriate environment variables set (again per instructions). 3. After checking out the latest PDFBox source, I modified build.xml under the "pdfbox" directory. Here's the diff: 43a44 > =A0 =A0 <property name=3D"fontbox.name" value=3D"fontbox-1.6.0" /> 53a55 > =A0 =A0 <property name=3D"jempbox.name" value=3D"jempbox-1.6.0" /> 114c116 < =A0 =A0 <property name=3D"ikvm.dir" value=3D"."/> --- > =A0 =A0 <property name=3D"ikvm.dir" value=3D"C:\\Program Files\\IKVM\\ikv= m-83.161.120.155"/> 3a. Without the two lines added for "fontbox.name" and "jempbox.name" my build produced: ${fontbox.name}.dll and ${jempbox.name}.dll instead of the appropriately na= med: fontbox-1.6.0.dll and jempbox-1.6.0.dll 3b. Changing the "ikvm.dir" is per the build instructions and "value" should be set to the root of _your_ ikvm directory. 4. Open a command prompt and cd into the "pdfbox" directory (where build.xml lives). 5. Execute the following command -> ant build.NET I get quite a few warnings (so I'm not positive my setup is 100%), but it does build the binaries. Bill From dhernandez@example.net Tue Jun 7 04:00:37 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id CE0B76FD5 for <dhernandez@example.net>; Tue, 7 Jun 2011 04:00:37 +0000 (UTC) Received: (qmail 63992 invoked by uid 500); 7 Jun 2011 04:00:37 -0000 Delivered-To: dhernandez@example.net Received: (qmail 63934 invoked by uid 500); 7 Jun 2011 04:00:32 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 63925 invoked by uid 99); 7 Jun 2011 04:00:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2011 04:00:30 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_FREEMAIL_DOC_PDF,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-fx0-f48.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2011 04:00:25 +0000 Received: by fxm7 with SMTP id 7so4902357fxm.21 for <dhernandez@example.net>; Mon, 06 Jun 2011 21:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=63rZH/ytiyZKpWbSvwjPMiit6KWtQ0DUD7fUEtH3ASw=; b=eMf2sUKQBruaR5n979bMdGyOJ+BlyN51JYWblCo7804z8VCoRRGi3M34WrWbiHaBEC EnMXUVgh13Cly9+IoDS6apVcgQDAR4AeOWjr2Z0oFgHSVBZ2f4uVKISFR7matcXuA55s lFSdR2jki2zZx9bfCruAB5xMhGIa3OpFOKSa0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=jquqAUSw00CZLI0lGuSfHzPB4LTNA6iRhAAiFl3p/cezvsdy2jCO9nPtddDBdv7jvu knFfC2r9n1aR9YBcMBnifSAtnN2M30rOqoPkGMPOjxlu2y1b4baAkL/hmwUfbeKkUiq4 mE0Owjza9sqPt0vH6IID0ZROZ+m50DKg/B0DA= Received: by 83.161.120.155 with SMTP id s20mr478845fau.10.1307419201259; Mon, 06 Jun 2011 21:00:01 -0700 (PDT) MIME-Version: 1.0 Received: by 83.161.120.155 with HTTP; Mon, 6 Jun 2011 20:59:40 -0700 (PDT) From: kirillkh <dhernandez@example.net> Date: Tue, 7 Jun 2011 06:59:40 +0300 Message-ID: <dhernandez@example.net> Subject: PDFTextStripper: space characters inside words To: dhernandez@example.net Content-Type: multipart/mixed; boundary=0023545bd3ec104c2b04a5174141 --0023545bd3ec104c2b04a5174141 Content-Type: multipart/alternative; boundary=0023545bd3ec104c2304a517413f --0023545bd3ec104c2304a517413f Content-Type: text/plain; charset=ISO-8859-1 Hi, I've encountered two issues with PDFTextStripper and discovered (imperfect) workarounds for both. Can anyone from the maintainers please take a look at the issues and at my patch (which is admittedly pretty hackish)? The patch is based off trunk, but I only tested it with PDFBox 1.5.0. https://github.com/kirillkh/pdfbox/commit/9a23c3956a96c276dfc677a0862c6954661b6d6a 1. With the attached document (I hope it will be accepted by the mailing list... If not, contact me, and I'll send it to you directly.), I'm seeing spaces interspersed inside certain words (e.g., in the second page's title.) The document is in Hebrew (RTL), which might or might not matter. While I don't know what exactly the code is doing, I got the impression that the problem is caused by zero-width space characters. Looks like the document was produced by software that incorrectly specified the width of every space character as 0 and also inserted them at random places inside the document. (Does that make any sense?.. In any case, that was my impression.) I assume that a real PDF renderer just ignores such characters, but PDFTextStripper outputs every such character as text. I've managed to modify the code in a way that makes these space characters be ignored (see the patch), but chances are it is not the best solution. 2. (RTL-specific) After working around the main issue, I've encountered another one. In some cases, the zero-width space characters coincided with word boundaries; since I removed them, PDFTextStripper switched to using the average character width to determine word boundaries. This resulted in special WordSeparator positions being inserted where spaces were before. The problem with that is the PDFTextStripper.normalize() method for some reason splits the text on these word boundaries (instead of splitting it on the line boundaries) to perform visual-to-logical reordering. For some lines, this results in words order being reversed (the characters inside words are in the correct order, the words are ordered in reverse). I solved this by outputting a space character for every WordSeparator encountered by normalize(). Again, this worked for me with this document, but I'm not sure that is the right way to go. -Kirill --0023545bd3ec104c2304a517413f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hi,<br><br>I&#39;ve encountered two issues with PDFTextStr= ipper and discovered (imperfect) workarounds for both. Can anyone from the = maintainers please take a look at the issues and at my patch (which is admi= ttedly pretty hackish)?<br> The patch is based off trunk, but I only tested it with PDFBox 1.5.0. <a hr= ef=3D"https://github.com/kirillkh/pdfbox/commit/9a23c3956a96c276dfc677a0862= c6954661b6d6a">https://github.com/kirillkh/pdfbox/commit/9a23c3956a96c276df= c677a0862c6954661b6d6a</a><br> <br>1. With the attached document (I hope it will be accepted by the mailin= g list... If not, contact me, and I&#39;ll send it to you directly.), I&#39= ;m seeing spaces interspersed inside certain words (e.g., in the second pag= e&#39;s title.) The document is in Hebrew (RTL), which might or might not m= atter.<br> <br>While I don&#39;t know what exactly the code is doing, I got the impres= sion that the problem is caused by zero-width space characters. Looks like = the document was produced by software that incorrectly specified the width = of every space character as 0 and also inserted them at random places insid= e the document. (Does that make any sense?.. In any case, that was my impre= ssion.) I assume that a real PDF renderer just ignores such characters, but= PDFTextStripper outputs every such character as text. I&#39;ve managed to = modify the code in a way that makes these space characters be ignored (see = the patch), but chances are it is not the best solution.<br> <br>2. (RTL-specific) After working around the main issue, I&#39;ve encount= ered another one. In some cases, the zero-width space characters coincided = with word boundaries; since I removed them, PDFTextStripper switched to usi= ng the average character width to determine word boundaries. This resulted = in special WordSeparator positions being inserted where spaces were before.= The problem with that is the PDFTextStripper.normalize() method for some r= eason splits the text on these word boundaries (instead of splitting it on = the line boundaries) to perform visual-to-logical reordering. For some line= s, this results in words order being reversed (the characters inside words = are in the correct order, the words are ordered in reverse).<br> <br>I solved this by outputting a space character for every WordSeparator e= ncountered by normalize(). Again, this worked for me with this document, bu= t I&#39;m not sure that is the right way to go.<br><br><br>-Kirill<br> </div> --0023545bd3ec104c2304a517413f-- --0023545bd3ec104c2b04a5174141-- From dhernandez@example.net Tue Jun 7 12:25:04 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id A3204608C for <dhernandez@example.net>; Tue, 7 Jun 2011 12:25:04 +0000 (UTC) Received: (qmail 47139 invoked by uid 500); 7 Jun 2011 12:25:04 -0000 Delivered-To: dhernandez@example.net Received: (qmail 47117 invoked by uid 500); 7 Jun 2011 12:25:04 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 47109 invoked by uid 99); 7 Jun 2011 12:25:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2011 12:25:04 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO BHEXCHANGE.blockhouse.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2011 12:24:59 +0000 X-Ninja-PIM: Scanned by Ninja X-Ninja-AttachmentFiltering: (no action) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CC250D.DACB7213" X-MimeOLE: Produced By Microsoft Exchange V6.5 Subject: Create and Merge PDF What Am I Missing? Date: Tue, 7 Jun 2011 08:24:32 -0400 Message-ID: <dhernandez@example.net> Thread-Topic: Create and Merge PDF What Am I Missing? Thread-Index: AcwlDdrNXrDRlHxxTJKRKohQdLMjAA== From: "Eric Douglas" <dhernandez@example.net> To: <dhernandez@example.net> ------_=_NextPart_001_01CC250D.DACB7213 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I used FOP to create a PDF in byte[] form. Now I load the PDF into pdfbox. If I save it looks fine. If I pass it into a viewer I get problems. I generated an array of these PDFs and I need to combine them. I start with just saving the first one. ByteArrayInputStream myBAIS =3D new ByteArrayInputStream(myByteData.get(0)); PDDocument myPDDocument =3D PDDocument.load(myBAIS); myPDDocument.save(myJobName + ".pdf"); If I open this PDF in Adobe Acrobat I can see everything just fine. If I open this PDF in a viewer it shows all graphics, including SVG and blocks with borders, but no text. I tried loading it into iText with the sample code found here (http://technology.amis.nl/blog/4174/java-generating-pdf-and-previewing- it-as-an-image-itext-and-pdf-renderer). I tried loading it into PDFRenderer (http://java.net/projects/pdf-renderer) using the viewer in their trunk demos, same result. No errors on either, they just don't display text. Now I try merging PDFs and again I can save the PDF I created and it looks fine in Acrobat though it's missing something. If there's only one PDF in my array, this method saves it about 2k smaller than saving it directly. The PDF array is a single document of separate documents, generated using xsl:initial-page-number. PDDocument myPDDocument =3D new PDDocument(); ArrayList<PDDocument> part =3D new ArrayList<PDDocument>(); for (int pdfLoop =3D 0; pdfLoop < myByteData.size(); pdfLoop ++) { ByteArrayInputStream myBAIS =3D new ByteArrayInputStream(myByteData.get(pdfLoop)); part.add(PDDocument.load(myBAIS)); myBAIS.close(); PDDocument partDoc =3D part.get(pdfLoop); @SuppressWarnings("unchecked") List<PDPage> list =3D partDoc.getDocumentCatalog().getAllPages(); for (PDPage page : list) { myPDDocument.addPage(page); } } myPDDocument.save(myJobName + ".pdf"); I get this error from the PDFRenderer viewer on the merged PDF: com.sun.pdfview.PDFParseException: No dictionary called Font found in the dhernandez@example.net(PDFParser.java:912) at com.sun.pdfview.PDFParser.getFontFrom(PDFParser.java:1165) at com.sun.pdfview.PDFParser.iterate(PDFParser.java:719) at com.sun.pdfview.BaseWatchable.run(BaseWatchable.java:101) at java.lang.Thread.run(Thread.java:662) ------_=_NextPart_001_01CC250D.DACB7213-- From dhernandez@example.net Thu Jun 9 13:47:41 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id 4F74F6D9A for <dhernandez@example.net>; Thu, 9 Jun 2011 13:47:41 +0000 (UTC) Received: (qmail 64352 invoked by uid 500); 9 Jun 2011 13:47:41 -0000 Delivered-To: dhernandez@example.net Received: (qmail 64339 invoked by uid 500); 9 Jun 2011 13:47:41 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 64319 invoked by uid 99); 9 Jun 2011 13:47:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2011 13:47:40 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO asmtpout029.mac.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2011 13:47:32 +0000 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from [83.161.120.155] (142-165-93-83.regn.hsdb.sasknet.sk.ca [83.161.120.155]) by asmtp029.mac.com (Oracle Communications Messaging Exchange Server 7u4-20.01 64bit (built Nov 21 2010)) with ESMTPSA id <dhernandez@example.net> for dhernandez@example.net; Thu, 09 Jun 2011 06:46:49 -0700 (PDT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.4.6813,1.0.148,0.0.0000 definitions=2011-06-09_03:2011-06-09,2011-06-08,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=1 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1012030000 definitions=main-1106090064 From: dhernandez@example.net Subject: Can view document, but getPrintable fails due to unknown compression of zip stream Date: Thu, 09 Jun 2011 07:46:46 -0600 Message-id: <dhernandez@example.net> To: dhernandez@example.net X-Mailer: Apple Mail (2.1084) X-Virus-Checked: Checked by ClamAV on apache.org Hello, I am using PDFBox to print PDF's. I have come across a PDF which I can not print. FlateFilter is thrown a ZipException due to an unknown compression method. Yet, I know PDFBox can handle the file, because PDFReader, and PrintPDF utilities work fine. (aside: Speaking of which, could the error message printed when this happens be more specific than "Stop reading corrupt stream". ) So I am not sure if the bug is in my code or PDFBox's; this is the code I am using to print, which works with most PDF's. public class MyPdfDoc implements Printable { private PDDocument pdfDoc; public MyPdfDoc( String path ) { try { pdfDoc = PDDocument.load(path); } catch( IOException e ) { log.severe("failed to load " + path + ": " + e); pdfDoc = null; } } @Override public int print( Graphics graphics, PageFormat pageFormat, int pageIndex ) throws PrinterException { if( pdfDoc == null || pageIndex >= pdfDoc.getNumberOfPages() ) { return NO_SUCH_PAGE; } Printable printable = pdfDoc.getPrintable(pageIndex); return printable.print(graphics, pageFormat, pageIndex); } } Any help appreciated, thanks. ~S From dhernandez@example.net Thu Jun 9 14:48:30 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id 368FA68D2 for <dhernandez@example.net>; Thu, 9 Jun 2011 14:48:30 +0000 (UTC) Received: (qmail 5288 invoked by uid 500); 9 Jun 2011 14:48:30 -0000 Delivered-To: dhernandez@example.net Received: (qmail 5269 invoked by uid 500); 9 Jun 2011 14:48:30 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Delivered-To: moderator for dhernandez@example.net Received: (qmail 1746 invoked by uid 99); 9 Jun 2011 14:47:35 -0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_cSd7CstlhPvB2wUXQhXjRA)" X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.4.6813,1.0.148,0.0.0000 definitions=2011-06-09_03:2011-06-09,2011-06-08,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=1 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1012030000 definitions=main-1106090082 From: Shea Martin <dhernandez@example.net> Subject: Re: Can view document, but getPrintable fails due to unknown compression of zip stream Date: Thu, 09 Jun 2011 08:46:51 -0600 In-reply-to: <dhernandez@example.net> To: dhernandez@example.net References: <dhernandez@example.net> Message-id: <dhernandez@example.net> X-Mailer: Apple Mail (2.1084) --Boundary_(ID_cSd7CstlhPvB2wUXQhXjRA) Content-type: text/plain; CHARSET=US-ASCII Content-transfer-encoding: 7BIT I should also note that I am printing the MyPdfDoc using printJob.setPrintable(). The PrintPDF utility which is part of PDF box, uses printJob.setPageable(). Should this matter? On 2011-06-09, at 7:46 AM, dhernandez@example.net wrote: > > Hello, > > I am using PDFBox to print PDF's. I have come across a PDF which I can not print. FlateFilter is thrown a ZipException due to an unknown compression method. Yet, I know PDFBox can handle the file, because PDFReader, and PrintPDF utilities work fine. (aside: Speaking of which, could the error message printed when this happens be more specific than "Stop reading corrupt stream". ) > > So I am not sure if the bug is in my code or PDFBox's; this is the code I am using to print, which works with most PDF's. > > public class MyPdfDoc implements Printable > { > > private PDDocument pdfDoc; > > public MyPdfDoc( String path ) > { > try > { > pdfDoc = PDDocument.load(path); > } > catch( IOException e ) > { > log.severe("failed to load " + path + ": " + e); > pdfDoc = null; > } > } > > @Override > public int print( Graphics graphics, PageFormat pageFormat, int pageIndex ) throws PrinterException > { > if( pdfDoc == null || pageIndex >= pdfDoc.getNumberOfPages() ) > { > return NO_SUCH_PAGE; > } > > Printable printable = pdfDoc.getPrintable(pageIndex); > return printable.print(graphics, pageFormat, pageIndex); > } > } > > Any help appreciated, thanks. > ~S ---------------- Shea Martin <contact info> --Boundary_(ID_cSd7CstlhPvB2wUXQhXjRA)-- From dhernandez@example.net Thu Jun 9 16:30:19 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id 6002C6F8E for <dhernandez@example.net>; Thu, 9 Jun 2011 16:30:19 +0000 (UTC) Received: (qmail 44124 invoked by uid 500); 9 Jun 2011 16:30:18 -0000 Delivered-To: dhernandez@example.net Received: (qmail 44105 invoked by uid 500); 9 Jun 2011 16:30:18 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 44072 invoked by uid 99); 9 Jun 2011 16:30:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2011 16:30:18 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO asmtpout022.mac.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2011 16:30:12 +0000 MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_ADqYdtJ0eqLqco2Cv2+q7Q)" Received: from [83.161.120.155] (142-165-93-83.regn.hsdb.sasknet.sk.ca [83.161.120.155]) by asmtp022.mac.com (Oracle Communications Messaging Exchange Server 7u4-20.01 64bit (built Nov 21 2010)) with ESMTPSA id <dhernandez@example.net> for dhernandez@example.net; Thu, 09 Jun 2011 09:29:52 -0700 (PDT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.4.6813,1.0.148,0.0.0000 definitions=2011-06-09_03:2011-06-09,2011-06-08,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=1 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1012030000 definitions=main-1106090112 From: Shea Martin <dhernandez@example.net> Subject: Re: Can view document, but getPrintable fails due to unknown compression of zip stream Date: Thu, 09 Jun 2011 10:29:49 -0600 In-reply-to: <dhernandez@example.net> To: dhernandez@example.net References: <dhernandez@example.net> Message-id: <dhernandez@example.net> X-Mailer: Apple Mail (2.1084) --Boundary_(ID_ADqYdtJ0eqLqco2Cv2+q7Q) Content-type: text/plain; CHARSET=US-ASCII Content-transfer-encoding: 7BIT I have removed my code from suspicion, the following fails with pdfbox, jempbox, and fontbox in my classpath. But if I put run pdfbox-app, as a PrintPDF, or PDFReader it works on the same pdf. The app jar must include something extra? The following produces the same corrupt stream error. static void main(String[] args) { PDDocument pdf = PDDocument.load("testdata/cash_for_keys.pdf"); pdf.silentPrint(); } On 2011-06-09, at 7:46 AM, dhernandez@example.net wrote: > > Hello, > > I am using PDFBox to print PDF's. I have come across a PDF which I can not print. FlateFilter is thrown a ZipException due to an unknown compression method. Yet, I know PDFBox can handle the file, because PDFReader, and PrintPDF utilities work fine. (aside: Speaking of which, could the error message printed when this happens be more specific than "Stop reading corrupt stream". ) > > So I am not sure if the bug is in my code or PDFBox's; this is the code I am using to print, which works with most PDF's. > > public class MyPdfDoc implements Printable > { > > private PDDocument pdfDoc; > > public MyPdfDoc( String path ) > { > try > { > pdfDoc = PDDocument.load(path); > } > catch( IOException e ) > { > log.severe("failed to load " + path + ": " + e); > pdfDoc = null; > } > } > > @Override > public int print( Graphics graphics, PageFormat pageFormat, int pageIndex ) throws PrinterException > { > if( pdfDoc == null || pageIndex >= pdfDoc.getNumberOfPages() ) > { > return NO_SUCH_PAGE; > } > > Printable printable = pdfDoc.getPrintable(pageIndex); > return printable.print(graphics, pageFormat, pageIndex); > } > } > > Any help appreciated, thanks. > ~S ---------------- Shea Martin <contact info> --Boundary_(ID_ADqYdtJ0eqLqco2Cv2+q7Q)-- From dhernandez@example.net Thu Jun 9 16:48:16 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id C942F6C5B for <dhernandez@example.net>; Thu, 9 Jun 2011 16:48:16 +0000 (UTC) Received: (qmail 3461 invoked by uid 500); 9 Jun 2011 16:48:16 -0000 Delivered-To: dhernandez@example.net Received: (qmail 3429 invoked by uid 500); 9 Jun 2011 16:48:16 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 3421 invoked by uid 99); 9 Jun 2011 16:48:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2011 16:48:16 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO asmtpout026.mac.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2011 16:48:09 +0000 MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_7MR3lbFfE+8D6/8CC7qJ1g)" Received: from [83.161.120.155] (142-165-93-83.regn.hsdb.sasknet.sk.ca [83.161.120.155]) by asmtp026.mac.com (Oracle Communications Messaging Exchange Server 7u4-20.01 64bit (built Nov 21 2010)) with ESMTPSA id <dhernandez@example.net> for dhernandez@example.net; Thu, 09 Jun 2011 09:47:19 -0700 (PDT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.4.6813,1.0.148,0.0.0000 definitions=2011-06-09_03:2011-06-09,2011-06-08,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=1 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1012030000 definitions=main-1106090119 From: Shea Martin <dhernandez@example.net> Subject: Re: Can view document, but getPrintable fails due to unknown compression of zip stream Date: Thu, 09 Jun 2011 10:47:17 -0600 In-reply-to: <dhernandez@example.net> To: dhernandez@example.net References: <dhernandez@example.net> <dhernandez@example.net> Message-id: <dhernandez@example.net> X-Mailer: Apple Mail (2.1084) X-Virus-Checked: Checked by ClamAV on apache.org --Boundary_(ID_7MR3lbFfE+8D6/8CC7qJ1g) Content-type: text/plain; CHARSET=US-ASCII Content-transfer-encoding: 7BIT Solution: pdf.decrypt(""); I guess this is somehting I have to check from now on. Perhaps a better erorr message would help people with this in the future. CHeers, ~S On 2011-06-09, at 10:29 AM, Shea Martin wrote: > I have removed my code from suspicion, the following fails with pdfbox, jempbox, and fontbox in my classpath. But if I put run pdfbox-app, as a PrintPDF, or PDFReader it works on the same pdf. The app jar must include something extra? > > The following produces the same corrupt stream error. > static void main(String[] args) > { > PDDocument pdf = PDDocument.load("testdata/cash_for_keys.pdf"); > pdf.silentPrint(); > } > On 2011-06-09, at 7:46 AM, dhernandez@example.net wrote: > >> >> Hello, >> >> I am using PDFBox to print PDF's. I have come across a PDF which I can not print. FlateFilter is thrown a ZipException due to an unknown compression method. Yet, I know PDFBox can handle the file, because PDFReader, and PrintPDF utilities work fine. (aside: Speaking of which, could the error message printed when this happens be more specific than "Stop reading corrupt stream". ) >> >> So I am not sure if the bug is in my code or PDFBox's; this is the code I am using to print, which works with most PDF's. >> >> public class MyPdfDoc implements Printable >> { >> >> private PDDocument pdfDoc; >> >> public MyPdfDoc( String path ) >> { >> try >> { >> pdfDoc = PDDocument.load(path); >> } >> catch( IOException e ) >> { >> log.severe("failed to load " + path + ": " + e); >> pdfDoc = null; >> } >> } >> >> @Override >> public int print( Graphics graphics, PageFormat pageFormat, int pageIndex ) throws PrinterException >> { >> if( pdfDoc == null || pageIndex >= pdfDoc.getNumberOfPages() ) >> { >> return NO_SUCH_PAGE; >> } >> >> Printable printable = pdfDoc.getPrintable(pageIndex); >> return printable.print(graphics, pageFormat, pageIndex); >> } >> } >> >> Any help appreciated, thanks. >> ~S > > ---------------- > Shea Martin > <contact info> > > > ---------------- Shea Martin <contact info> --Boundary_(ID_7MR3lbFfE+8D6/8CC7qJ1g)-- From dhernandez@example.net Fri Jun 10 08:18:16 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id 048014AAC for <dhernandez@example.net>; Fri, 10 Jun 2011 08:18:16 +0000 (UTC) Received: (qmail 42346 invoked by uid 500); 10 Jun 2011 08:18:15 -0000 Delivered-To: dhernandez@example.net Received: (qmail 42308 invoked by uid 500); 10 Jun 2011 08:18:15 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 42300 invoked by uid 99); 10 Jun 2011 08:18:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jun 2011 08:18:15 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mo-p00-ob.rzone.de) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jun 2011 08:18:07 +0000 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1307693867; l=1440; s=domk; d=lehmi.de; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References: Subject:CC:To:MIME-Version:Reply-To:From:Date:X-RZG-CLASS-ID: X-RZG-AUTH; bh=UD5YFy8GLEZLccMf7sLPHGgD8j4=; b=TOOLB1HewHxbH5VTo5tn1fLlj0riGs93Ad5eEAVPOZaFlF/8ImSiF+bM3ZaKTyEiWm4 P5cheM2geiRZLAwS979MvWwlYBQcF07RvFXgyFToF3fsJK/gp0pPvIL7Ry17JgzTYSHq+ FyPKcpL2vF55ONOdF/XC3uVa+trwh9cZ7sM= X-RZG-AUTH: :LWIAZ0WpaN8UY5o8XRz0jOyrHsdEC+nAE10OdySrgHLykukazhxbhO5hlAJW5Q== X-RZG-CLASS-ID: mo00 Received: from Lehmis-Mac.local ([83.161.120.155]) by post.strato.de (jimi mo39) (RZmta 25.18) with ESMTPA id q01757n5A7Sw80 ; Fri, 10 Jun 2011 10:17:46 +0200 (MEST) Message-ID: <dhernandez@example.net> Date: Fri, 10 Jun 2011 10:17:45 +0200 From: =?ISO-8859-1?Q?Andreas_Lehmk=FChler?= <dhernandez@example.net> Reply-To: dhernandez@example.net User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:83.161.120.155) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Gilad Denneboom <dhernandez@example.net> CC: dhernandez@example.net Subject: Re: PDFBox form fields help References: <dhernandez@example.net> In-Reply-To: <dhernandez@example.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Gilad, please don't contact the developers directly. Adress your questions to the mailinglists, so that everybody from the community has the chance to help and to learn as well. I've cc'd my answer to the users-list. Am 09.06.11 12:10, schrieb Gilad Denneboom: > Hi Andreas, > > Thanks for helping out with the issues I've created for PDFBox. > > I would really appreciate it if you could help me out with the > following: I'm trying to add form fields to a file using PDFBox and am > having a lot of problems with it. I was unable to find any real examples > on how it should be done, neither online or in the example packages. > The closest I've come so far is in the attached file. When I open the > result PDF in Acrobat, though, I can't see the field. When I open the JS > console it says "Some fields are malformed, and may not work as > expected. Please contact the author for a fix". > I am then able to execute getField("Text1").value and get the value I've > set, but most other properties and methods fail. > > Any help you can offer will be greatly appreciated, and I might even > create an example class for the next release of PDFBox, if you think > it's a good idea... I'm not an acroform expert but you have to link the new field to the page it should be rendered on. I guess it has to be done by using an annotation widget. A simple example woiuld be great. BR Andreas Lehmkühler From dhernandez@example.net Fri Jun 10 08:57:38 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id B449F4637 for <dhernandez@example.net>; Fri, 10 Jun 2011 08:57:38 +0000 (UTC) Received: (qmail 89645 invoked by uid 500); 10 Jun 2011 08:57:38 -0000 Delivered-To: dhernandez@example.net Received: (qmail 89627 invoked by uid 500); 10 Jun 2011 08:57:38 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Delivered-To: moderator for dhernandez@example.net Received: (qmail 58167 invoked by uid 99); 10 Jun 2011 08:32:33 -0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=d/gGqWkKYaHc2Kb4Cy5/Uq7pGGC0FoxQ1xrc4ZPGGPM=; b=fxHqo/55GdYUvYJ0N37vPjOaXm0e0PqGfbb3TORpFIA6o74mkHaoieaXiyElEF8G+9 GctcS4rqY/KKsl0t25b+m9wAtFpgJHC2+XcC2fGCRVwvwK6I0q1NCbmJuCJYEHNZ4Rn1 Opdk9rSgUeLZu0A38PI79eLMPlQA8psrP9ZmQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=rCZjeRZKrUZNM5l+5CCgz5ODWHesFuKpgElW0QVXqmMCaU6lVTbYjfa58RW9RhiuRZ yfvhcsGoSgq7Tl6xZtuDF4rsgIFYndalAONigiP1n+YaQd+rLAcxYDtfRsRP1F/qeTv8 +hlRcl7WvaQ/I1Nj3M1ZjBk49k5WIg6NnO3wE= MIME-Version: 1.0 In-Reply-To: <dhernandez@example.net> References: <dhernandez@example.net> <dhernandez@example.net> From: Gilad Denneboom <dhernandez@example.net> Date: Fri, 10 Jun 2011 10:31:48 +0200 Message-ID: <dhernandez@example.net> Subject: Re: PDFBox form fields help To: dhernandez@example.net Content-Type: multipart/alternative; boundary=bcaec53149f1c0269b04a5576702 --bcaec53149f1c0269b04a5576702 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sorry about that... I wasn't aware of the mailinglist. I've tried adding the widget to the page annotations list, but to no avail. Here's the code I've used to create the field: PDTextbox textField =3D new PDTextbox(doc.getDocumentCatalog().getAcroForm()); PDRectangle rect =3D new PDRectangle(); rect.setLowerLeftX((float) 88.14579772949219); rect.setLowerLeftY((float) 394.781005859375); rect.setUpperRightX((float) 232.9340057373047); rect.setUpperRightY((float) 416.5929870605469); textField.getWidget().setRectangle(rect); textField.setPartialName("Text1"); textField.setValue("some text"); I then tried adding it to the acroform/page in various ways: PDPage page0 =3D (PDPage) doc.getDocumentCatalog().getAllPages().get(0); page0.getAnnotations().add(textField); page0.getAnnotations().add(textField.getWidget()); This yielded no results. doc.getDocumentCatalog().getAcroForm().getFields().add(textField); doc.getDocumentCatalog().getAcroForm().getFields().add(textField.getWidget(= )); When I run any of these lines the field is added (I checked the length of the getFields()), and in Acrobat I can see (through the JS console) that there's a field called "Text1" with the correct value, but the field is not visible, and I get the aforementioned error messages about it being "malformed". PS - is there a web interface for these mailing-lists? Like Google Groups? Gilad 2011/6/10 Andreas Lehmk=FChler <dhernandez@example.net> > Hi Gilad, > > please don't contact the developers directly. Adress your questions to th= e > mailinglists, so that everybody from the community has the chance to help > and to learn as well. > > I've cc'd my answer to the users-list. > > Am 09.06.11 12:10, schrieb Gilad Denneboom: > > Hi Andreas, >> >> Thanks for helping out with the issues I've created for PDFBox. >> >> I would really appreciate it if you could help me out with the >> following: I'm trying to add form fields to a file using PDFBox and am >> having a lot of problems with it. I was unable to find any real examples >> on how it should be done, neither online or in the example packages. >> The closest I've come so far is in the attached file. When I open the >> result PDF in Acrobat, though, I can't see the field. When I open the JS >> console it says "Some fields are malformed, and may not work as >> expected. Please contact the author for a fix". >> I am then able to execute getField("Text1").value and get the value I've >> set, but most other properties and methods fail. >> >> Any help you can offer will be greatly appreciated, and I might even >> create an example class for the next release of PDFBox, if you think >> it's a good idea... >> > I'm not an acroform expert but you have to link the new field to the page > it should be rendered on. I guess it has to be done by using an annotatio= n > widget. > > A simple example woiuld be great. > > BR > Andreas Lehmk=FChler > > > --bcaec53149f1c0269b04a5576702-- From dhernandez@example.net Fri Jun 10 09:03:35 2011 Return-Path: <dhernandez@example.net> X-Original-To: dhernandez@example.net Delivered-To: dhernandez@example.net Received: from mail.apache.org (hermes.apache.org [83.161.120.155]) by minotaur.apache.org (Postfix) with SMTP id B4C8948CF for <dhernandez@example.net>; Fri, 10 Jun 2011 09:03:35 +0000 (UTC) Received: (qmail 94278 invoked by uid 500); 10 Jun 2011 09:03:35 -0000 Delivered-To: dhernandez@example.net Received: (qmail 94257 invoked by uid 500); 10 Jun 2011 09:03:35 -0000 Mailing-List: contact dhernandez@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:dhernandez@example.net> List-Unsubscribe: <mailto:dhernandez@example.net> List-Post: <mailto:dhernandez@example.net> List-Id: <users.pdfbox.apache.org> Reply-To: dhernandez@example.net Delivered-To: mailing list dhernandez@example.net Received: (qmail 94249 invoked by uid 99); 10 Jun 2011 09:03:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jun 2011 09:03:35 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dhernandez@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO smtprelay03.ispgateway.de) (83.161.120.155) by
{'source': 'Apache Software Foundation Public Mail Archives'}