Return-Path: X-Original-To: apmail-pdfbox-users-archive@www.apache.org Delivered-To: apmail-pdfbox-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 96C5C9CC0 for ; Fri, 5 Oct 2012 21:15:18 +0000 (UTC) Received: (qmail 30929 invoked by uid 500); 5 Oct 2012 21:15:18 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 30909 invoked by uid 500); 5 Oct 2012 21:15:18 -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 30900 invoked by uid 99); 5 Oct 2012 21:15:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2012 21:15:18 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of SRS0=LgNUMc=IC=technoracle-systems.com=duane@yourhostingaccount.com designates 65.254.253.106 as permitted sender) Received: from [65.254.253.106] (HELO mailout13.yourhostingaccount.com) (65.254.253.106) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2012 21:15:09 +0000 Received: from mailscan20.yourhostingaccount.com ([10.1.15.20] helo=mailscan20.yourhostingaccount.com) by mailout13.yourhostingaccount.com with esmtp (Exim) id 1TKFEO-00046l-RW for users@pdfbox.apache.org; Fri, 05 Oct 2012 17:14:48 -0400 Received: from impout01.yourhostingaccount.com ([10.1.55.1] helo=impout01.yourhostingaccount.com) by mailscan20.yourhostingaccount.com with esmtp (Exim) id 1TKFEO-0002Id-E0 for users@pdfbox.apache.org; Fri, 05 Oct 2012 17:14:48 -0400 Received: from authsmtp16.yourhostingaccount.com ([10.1.18.16]) by impout01.yourhostingaccount.com with NO UCE id 7ZEo1k0040LoD9W01ZEoXU; Fri, 05 Oct 2012 17:14:48 -0400 X-Authority-Analysis: v=2.0 cv=IICA+3TG c=1 sm=1 a=agx8YuVllGl3eewrjI7/AQ==:17 a=VGyoxfwBYx8A:10 a=OqL4oJhYFnMA:10 a=AL35RHXkZZoA:10 a=xAmRWg7EO_AA:10 a=HrwbXxiEAAAA:8 a=lSXsbgfG7nwA:10 a=Nky2hzzcAAAA:8 a=HQ4Z0QhhAAAA:8 a=mV9VRH-2AAAA:8 a=d-78ZJPbY9M4C-EiueIA:9 a=CjuIK1q_8ugA:10 a=GxhG8uB7XH4A:10 a=J3viJR90KbcA:10 a=5o9UeY-YDV4A:10 a=oLkk1gJHvDYA:10 a=AMKoAdTmNsIA:10 a=gA6IeH5FQcgA:10 a=NWVoK91CQyQA:10 a=yMhMjlubAAAA:8 a=SSmOFEACAAAA:8 a=iwcJ2ZX4AAAA:8 a=ns8sjoJ_LBUcfQKgz8MA:9 a=UiCQ7L4-1S4A:10 a=hTZeC7Yk6K0A:10 a=6UIaq3Bcl8oA:10 a=_W_S_7VecoQA:10 a=frz4AuCg-hUA:10 a=r-odf9UOTM8A:10 a=q-rHiwPWVOqlWxGD:21 a=ltXMujfcukYoTVgNOHxvog==:117 X-EN-OrigOutIP: 10.1.18.16 X-EN-IMPSID: 7ZEo1k0040LoD9W01ZEoXU Received: from brln-4db9d699.pool.mediaways.net ([77.185.214.153] helo=[192.168.178.26]) by authsmtp16.yourhostingaccount.com with esmtpa (Exim) id 1TKFEM-0002To-Vk for users@pdfbox.apache.org; Fri, 05 Oct 2012 17:14:48 -0400 User-Agent: Microsoft-MacOutlook/14.2.4.120824 Date: Fri, 05 Oct 2012 23:14:39 +0200 Subject: Re: Font being changed after form field is set From: Duane Nickull To: Message-ID: Thread-Topic: Font being changed after form field is set In-Reply-To: Mime-version: 1.0 Content-type: multipart/alternative; boundary="B_3432323687_110819821" X-EN-UserInfo: 60f228330f5b315013890e73c698f9eb:2f1e48c4d61ea23f0071fa28fa4423f9 X-EN-AuthUser: duane@technoracle-systems.com Sender: Duane Nickull X-EN-OrigIP: 77.185.214.153 X-EN-OrigHost: brln-4db9d699.pool.mediaways.net --B_3432323687_110819821 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit PDF's have embedded fonts and system fonts. This is a complex topic (I used to work at Adobe for 8 years). It may be possible that the fonts are not available although in this case, courier is very common so I cannot see the issue. I want to respect the list's policy on promoting commercial software but if you want to discuss offline, I am available. Technoracle (my post- Adobe company) is comprised of many ex-Adobe PDF experts and we have perfected some solutions for rendering PDF forms on mobile. Nevertheless, I am here in this forum to share expertise when I can so I will focus on that first. BTW the attachment never came through. If you resend, I be more than happy to help you for free as a community member. Our emphasis is on mobile anyways so Duane Nickull *********************************** Technoracle Advanced Systems Inc. Consulting and Contracting; Proven Results! i. Neo4J, PDF, Java, LiveCycle ES, Flex, AIR, CQ5 & Mobile b. http://technoracle.blogspot.com t. @duanechaos "Don't fear the Graph! Embrace Neo4J" From: Eugene Chang Reply-To: Date: Friday, 5 October, 2012 10:26 PM To: "users@pdfbox.apache.org" Subject: Font being changed after form field is set Hi, We have encounter a problem when using pdfbox. We have a pdf form with fields and font set to Courier (please see attached pdf file PRP.pdf). After running the program below which tries to set the value of one of the fields, font was being changed to Helvetica (please see attached pdf file forms26916.pdf). Is there any way we can set the values and retain the original font? Regards, Eugene package lab; import java.io.File; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDDocumentCatalog; import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm; public class TestBed1 { public static void main(String[] args) { try { PDDocument pdfDocument = PDDocument.load("C:/Temp/pdf/PRP.pdf"); PDDocumentCatalog docCatalog = pdfDocument.getDocumentCatalog(); PDAcroForm acroForm = docCatalog.getAcroForm(); acroForm.getField("officeAfterHourAndTollFree").setValue( "Phone: (805) 777-7666 Fax: (805) 777-9876"); File file = File.createTempFile("forms", ".pdf"); pdfDocument.save(file.getCanonicalPath()); pdfDocument.close(); System.out.println(file.getCanonicalPath()); } catch (Exception e) { e.printStackTrace(); } } } --B_3432323687_110819821--