pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodney Kite <rkit...@yahoo.com.INVALID>
Subject Re: Traversing and filling a PDF with 2.0
Date Fri, 30 Oct 2015 22:04:45 GMT
Here is one of them.   It had about 150 warnings for this one document.  

http://www.wildersmobile.com/web/pdf/SpacelySprockets.pdf


      From: Maruan Sahyoun <sahyoun@fileaffairs.de>
 To: users@pdfbox.apache.org; Rodney Kite <rkite01@yahoo.com> 
 Sent: Friday, October 30, 2015 5:52 PM
 Subject: Re: Traversing and filling a PDF with 2.0
   
Hi,


> Am 30.10.2015 um 22:47 schrieb Rodney Kite <rkite01@yahoo.com.INVALID>:
> 
> It prints the same warning in the log over 359 times for one PDF dominating the log file. 
I do not think 1.8 printed anything to the log.  It is logging the same warning too many
times.  Once per PDF is enough.      
> 
> I was able to suppress it by changing the log level to ERROR instead of WARNING.  So
I do have a work around.  
> 
>            <logger category="org.apache.pdfbox.pdmodel.font">
>                <level name="ERROR"/>
>            </logger>
> 

would it be possible to share the file?

BR
Maruan


>      From: John Hewson <john@jahewson.com>
> To: users@pdfbox.apache.org; Rodney Kite <rkite01@yahoo.com> 
> Sent: Friday, October 30, 2015 4:30 PM
> Subject: Re: Traversing and filling a PDF with 2.0
> 
> Is it broken with 2.0? You haven’t mentioned anything that’s not working.
> 
> The warning is just to let you know that we substituted using a font which
> we know isn’t a perfect match but it’s the best we could find.
> 
> — John
> 
> 
> 
>> On 30 Oct 2015, at 08:05, Rodney Kite <rkite01@yahoo.com.INVALID> wrote:
>> 
>> Why did it work with 1.8?  Is there a way to suppress the warning or add the missing
font?  
>> 
>> 
>>      From: John Hewson <john@jahewson.com>
>> To: users@pdfbox.apache.org; Rodney Kite <rkite01@yahoo.com> 
>> Sent: Friday, October 30, 2015 3:30 AM
>> Subject: Re: Traversing and filling a PDF with 2.0
>> 
>> Unless you have HelveticaLTStd-Roman on your system, then it’s just intended behaviour.
>> 
>>> On 29 Oct 2015, at 18:55, Rodney Kite <rkite01@yahoo.com.INVALID> wrote:
>>> 
>>> I am filling the same PDF I have been using for months with 1.8 so I imagine
this is a bug.  
>>> 
>>>      From: Maruan Sahyoun <sahyoun@fileaffairs.de>
>>> To: users@pdfbox.apache.org; Rodney Kite <rkite01@yahoo.com> 
>>> Sent: Thursday, October 29, 2015 4:21 AM
>>> Subject: Re: Traversing and filling a PDF with 2.0
>>> 
>>> Hi,
>>> 
>>>> Am 29.10.2015 um 08:15 schrieb Rodney Kite <rkite01@yahoo.com.INVALID>:
>>>> 
>>>> Thanks,
>>>> I have it working but have not updated to the preferred way yet.  Now getting
the following warning over and over in my log.  I did not see this in 1.8.    
>>>> 
>>>> 03:10:19,441 WARN  [org.apache.pdfbox.pdmodel.font.PDType1Font] (default
task-35) Using fallback font ArialMT for HelveticaLTStd-Roman
>>> 
>>> that's because of the new Font handling where - if the font is not installed
or embedded - we try to find a fallback font. If you believe that the font is embedded in
the PDF or locally available then this might be a bug.
>>> 
>>> BR
>>> Maruan
>>> 
>>>> 
>>>>      From: Maruan Sahyoun <sahyoun@fileaffairs.de>
>>>> To: users@pdfbox.apache.org; Rodney Kite <rkite01@yahoo.com> 
>>>> Sent: Thursday, October 29, 2015 3:00 AM
>>>> Subject: Re: Traversing and filling a PDF with 2.0
>>>> 
>>>> Hi,
>>>> 
>>>>> Am 29.10.2015 um 07:53 schrieb Rodney Kite <rkite01@yahoo.com.INVALID>:
>>>>> 
>>>>> Not sure if there is a form object under a PDField?  I found this which
looks similar.
>>>> 
>>>> no, it's PDAcroForm.getFieldTree().
>>>> 
>>>> If you'd like to do the iteration similar to the old 1.8 API use
>>>> 
>>>> PDAcroForm.getFields()
>>>> check if the PDFields returned are PDNonTerminalField
>>>> if yes, use PDNonTerminalField.getChildren()
>>>> …
>>>> 
>>>> I'll add a sample of doing it both ways later today but the preferred API
is to use PDAcroForm.getFieldTree(). 
>>>> 
>>>> BR
>>>> Maruan
>>>> 
>>>> 
>>>>> 
>>>>> List<PDField> kids = ((PDNonTerminalField)pdField).getChildren();
>>>>> 
>>>>>      From: Maruan Sahyoun <sahyoun@fileaffairs.de>
>>>>> To: users@pdfbox.apache.org; Rodney Kite <rkite01@yahoo.com> 
>>>>> Sent: Thursday, October 29, 2015 2:34 AM
>>>>> Subject: Re: Traversing and filling a PDF with 2.0
>>>>> 
>>>>> Hi,
>>>>> 
>>>>>> Am 29.10.2015 um 07:23 schrieb Rodney Kite <rkite01@yahoo.com.INVALID>:
>>>>>> 
>>>>>>    I have been using PDFBox 1.8 and have just tried 2.0.  I have
been using PDFBox to open a blank goverment PDF and fill out fields while walking the document
like a DOM tree.  
>>>>>> 
>>>>>> So I have been using PDField.getKids() a lot to traverse the document.

>>>>> 
>>>>> you can use
>>>>> 
>>>>> for (PDField field : form.getFieldTree())
>>>>> {
>>>>> 
>>>>>    
>>>>> ... (do something)
>>>>> }
>>>>> 
>>>>> BR
>>>>> Maruan
>>>>> 
>>>>> 
>>>>> 
>>>>>> 
>>>>>> Can this still be done?  Is there an example on how to do it? 
I have looked at the examples with the source but only see getting a field by name and setting
it in the SetField.java example.  
>>>>>> 
>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org


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


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


  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message