You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Andrew Munn <an...@nmedia.net> on 2015/03/30 23:48:53 UTC

PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

	
In 2.0.0 what is the preferred way to do this?

PDPageContentStream cos = ...
cos.moveTextPositionByAmount(x,y);
cos.drawString("some text");

I see those two methods are both deprecated and the JavaDocs page is 
missing.

Also, my app is hanging at the drawString() method when run on Linux but 
works fine on Windows.  I'm thinking that's maybe font related?

Thanks

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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi,

> Am 30.03.2015 um 23:52 schrieb Andrew Munn <an...@nmedia.net>:
> 
> I was able to see in the index that drawString() was replaced by 
> showText().
> 
> The links in the index are broken though:
> http://pdfbox.apache.org/docs/2.0.0-SNAPSHOT/javadocs/index-all.html
> 

that seems to work fine for me - is there a specific link not working for you or is it a general issue so all links are not working?

BR
Maruan

> 
> 
> On Mon, 30 Mar 2015, Andrew Munn wrote:
> 
>> 	
>> In 2.0.0 what is the preferred way to do this?
>> 
>> PDPageContentStream cos = ...
>> cos.moveTextPositionByAmount(x,y);
>> cos.drawString("some text");
>> 
>> I see those two methods are both deprecated and the JavaDocs page is 
>> missing.
>> 
>> Also, my app is hanging at the drawString() method when run on Linux but 
>> works fine on Windows.  I'm thinking that's maybe font related?
>> 
>> Thanks
>> 
>> ---------------------------------------------------------------------
>> 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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Andrew Munn <an...@nmedia.net>.
I was able to see in the index that drawString() was replaced by 
showText().

The links in the index are broken though:
http://pdfbox.apache.org/docs/2.0.0-SNAPSHOT/javadocs/index-all.html



On Mon, 30 Mar 2015, Andrew Munn wrote:

> 	
> In 2.0.0 what is the preferred way to do this?
> 
> PDPageContentStream cos = ...
> cos.moveTextPositionByAmount(x,y);
> cos.drawString("some text");
> 
> I see those two methods are both deprecated and the JavaDocs page is 
> missing.
> 
> Also, my app is hanging at the drawString() method when run on Linux but 
> works fine on Windows.  I'm thinking that's maybe font related?
> 
> Thanks
> 
> ---------------------------------------------------------------------
> 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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Andrew Munn <an...@nmedia.net>.
> Am 01.04.2015 um 19:55 schrieb Andrew Munn:
> > > Maybe, but if there is an endless loop, we'd be VERY interested in finding
> > > out
> > > where it is and fix that bug. But we need your cooperation.
> > > 
> > I can profile the running app and look for hot spots.
> 
> This isn't about poor performance. You said it was HANGING.

If it's an endless loop the profiler should show what part of the code is 
running endlessly.   Maybe it's not looping, maybe it's blocked somewhere.

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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 01.04.2015 um 19:55 schrieb Andrew Munn:
>> Maybe, but if there is an endless loop, we'd be VERY interested in finding out
>> where it is and fix that bug. But we need your cooperation.
>>
> I can profile the running app and look for hot spots.

This isn't about poor performance. You said it was HANGING.

Tilman

>
> ---------------------------------------------------------------------
> 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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Andrew Munn <an...@nmedia.net>.
> 
> Maybe, but if there is an endless loop, we'd be VERY interested in finding out
> where it is and fix that bug. But we need your cooperation.
> 

I can profile the running app and look for hot spots.  

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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 01.04.2015 um 18:57 schrieb Andrew Munn:
>> Please do also search for *.pfb files.
>>
>> Anyway, the only solution for you now would be to try each of these fonts,
>> Copy the above into a file and then read the paths and then try if the effect
>> happens.
>>
> nada...
>
> [root@dev1 lib]# find / -name *.pfb -print
> [root@dev1 lib]# find / -name *pfb -print
> [root@dev1 lib]# find / -name *PFB -print
> [root@dev1 lib]#
>
> I guess I should install some basic font collection?

Maybe, but if there is an endless loop, we'd be VERY interested in 
finding out where it is and fix that bug. But we need your cooperation.

Tilman


>
> ---------------------------------------------------------------------
> 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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Andrew Munn <an...@nmedia.net>.
> Please do also search for *.pfb files.
> 
> Anyway, the only solution for you now would be to try each of these fonts,
> Copy the above into a file and then read the paths and then try if the effect
> happens.
> 

nada...

[root@dev1 lib]# find / -name *.pfb -print
[root@dev1 lib]# find / -name *pfb -print
[root@dev1 lib]# find / -name *PFB -print
[root@dev1 lib]#

I guess I should install some basic font collection?

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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 01.04.2015 um 16:44 schrieb Andrew Munn:
> On Wed, 1 Apr 2015, Tilman Hausherr wrote:
>> Could you do "svn update" because there was a bug with this fixed a few days
>> ago.
> I am downloading pdfbox-app-2.0.0-20150331.230831-1188.jar.  Should that
> be current enough?
>
>> Somehow this is a moving target. You initially said that a font hangs on
>> linux. I'd like you to try that specific font in windows, i.e. copy that font
>> file, then load that specific font with load(). "PDType1Font.TIMES_ROMAN" is
>> not a specific font, rather it is shown depending on whats available on the
>> OS. In windows, usually "Times New Roman".
> I'm not sure how to find what font PDType1Font.TIMES_ROMAN points to on
> the Linux box.  I don't have X installed on there either if that matters.
> ttf files are:
>
> [root@dev1 lib]# find / -name *ttf -print
> /usr/share/httpd/noindex/css/fonts/Bold/OpenSans-Bold.ttf
> /usr/share/httpd/noindex/css/fonts/BoldItalic/OpenSans-BoldItalic.ttf
> /usr/share/httpd/noindex/css/fonts/ExtraBold/OpenSans-ExtraBold.ttf
> /usr/share/httpd/noindex/css/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.ttf
> /usr/share/httpd/noindex/css/fonts/Italic/OpenSans-Italic.ttf
> /usr/share/httpd/noindex/css/fonts/Light/OpenSans-Light.ttf
> /usr/share/httpd/noindex/css/fonts/LightItalic/OpenSans-LightItalic.ttf
> /usr/share/httpd/noindex/css/fonts/Regular/OpenSans-Regular.ttf
> /usr/share/httpd/noindex/css/fonts/Semibold/OpenSans-Semibold.ttf
> /usr/share/httpd/noindex/css/fonts/SemiboldItalic/OpenSans-SemiboldItalic.ttf
> /opt/jdk8/jre/lib/fonts/LucidaSansDemiBold.ttf
> /opt/jdk8/jre/lib/fonts/LucidaBrightDemiItalic.ttf
> /opt/jdk8/jre/lib/fonts/LucidaBrightItalic.ttf
> /opt/jdk8/jre/lib/fonts/LucidaBrightRegular.ttf
> /opt/jdk8/jre/lib/fonts/LucidaSansRegular.ttf
> /opt/jdk8/jre/lib/fonts/LucidaTypewriterRegular.ttf
> /opt/jdk8/jre/lib/fonts/LucidaTypewriterBold.ttf
> /opt/jdk8/jre/lib/fonts/LucidaBrightDemiBold.ttf
> /opt/jdk8/jre/lib/oblique-fonts/LucidaSansOblique.ttf
> /opt/jdk8/jre/lib/oblique-fonts/LucidaTypewriterBoldOblique.ttf
> /opt/jdk8/jre/lib/oblique-fonts/LucidaSansDemiOblique.ttf
> /opt/jdk8/jre/lib/oblique-fonts/LucidaTypewriterOblique.ttf

Please do also search for *.pfb files.

Anyway, the only solution for you now would be to try each of these 
fonts, Copy the above into a file and then read the paths and then try 
if the effect happens.

Tilman

>
> What do you think?
>
> Thanks!
>
> ---------------------------------------------------------------------
> 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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Andrew Munn <an...@nmedia.net>.
On Wed, 1 Apr 2015, Tilman Hausherr wrote:
> Could you do "svn update" because there was a bug with this fixed a few days
> ago.

I am downloading pdfbox-app-2.0.0-20150331.230831-1188.jar.  Should that 
be current enough?

> Somehow this is a moving target. You initially said that a font hangs on
> linux. I'd like you to try that specific font in windows, i.e. copy that font
> file, then load that specific font with load(). "PDType1Font.TIMES_ROMAN" is
> not a specific font, rather it is shown depending on whats available on the
> OS. In windows, usually "Times New Roman".

I'm not sure how to find what font PDType1Font.TIMES_ROMAN points to on 
the Linux box.  I don't have X installed on there either if that matters.  
ttf files are:

[root@dev1 lib]# find / -name *ttf -print
/usr/share/httpd/noindex/css/fonts/Bold/OpenSans-Bold.ttf
/usr/share/httpd/noindex/css/fonts/BoldItalic/OpenSans-BoldItalic.ttf
/usr/share/httpd/noindex/css/fonts/ExtraBold/OpenSans-ExtraBold.ttf
/usr/share/httpd/noindex/css/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.ttf
/usr/share/httpd/noindex/css/fonts/Italic/OpenSans-Italic.ttf
/usr/share/httpd/noindex/css/fonts/Light/OpenSans-Light.ttf
/usr/share/httpd/noindex/css/fonts/LightItalic/OpenSans-LightItalic.ttf
/usr/share/httpd/noindex/css/fonts/Regular/OpenSans-Regular.ttf
/usr/share/httpd/noindex/css/fonts/Semibold/OpenSans-Semibold.ttf
/usr/share/httpd/noindex/css/fonts/SemiboldItalic/OpenSans-SemiboldItalic.ttf
/opt/jdk8/jre/lib/fonts/LucidaSansDemiBold.ttf
/opt/jdk8/jre/lib/fonts/LucidaBrightDemiItalic.ttf
/opt/jdk8/jre/lib/fonts/LucidaBrightItalic.ttf
/opt/jdk8/jre/lib/fonts/LucidaBrightRegular.ttf
/opt/jdk8/jre/lib/fonts/LucidaSansRegular.ttf
/opt/jdk8/jre/lib/fonts/LucidaTypewriterRegular.ttf
/opt/jdk8/jre/lib/fonts/LucidaTypewriterBold.ttf
/opt/jdk8/jre/lib/fonts/LucidaBrightDemiBold.ttf
/opt/jdk8/jre/lib/oblique-fonts/LucidaSansOblique.ttf
/opt/jdk8/jre/lib/oblique-fonts/LucidaTypewriterBoldOblique.ttf
/opt/jdk8/jre/lib/oblique-fonts/LucidaSansDemiOblique.ttf
/opt/jdk8/jre/lib/oblique-fonts/LucidaTypewriterOblique.ttf

What do you think?

Thanks!

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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Tilman Hausherr <TH...@t-online.de>.
Could you do "svn update" because there was a bug with this fixed a few 
days ago.

Somehow this is a moving target. You initially said that a font hangs on 
linux. I'd like you to try that specific font in windows, i.e. copy that 
font file, then load that specific font with load(). 
"PDType1Font.TIMES_ROMAN" is not a specific font, rather it is shown 
depending on whats available on the OS. In windows, usually "Times New 
Roman".

Tilman

Am 01.04.2015 um 02:56 schrieb Andrew Munn:
> Doing something like this was hanging it in Linux.
>
> font = PDType1Font.TIMES_ROMAN
> cos.showText(f.fieldName);
>
> In Windows I get:
> Exception in thread "main" java.lang.IllegalArgumentException: No glyph
> for U+0064 in font Times-Roman	at
> org.apache.pdfbox.pdmodel.font.PDType1Font.encode(PDType1Font.java:303)
> 	at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:268)
> 	at org.apache.pdfbox.pdmodel.PDPageContentStream.showText(PDPageContentStream.java:316)
>
> Thanks
>
>
> On Tue, 31 Mar 2015, Tilman Hausherr wrote:
>
>> Hi,
>>
>> I'd still like to know what happens if you transfer that font to windows.
>>
>> If it hangs: open in issue in JIRA and attach the font.
>>
>> Tilman
>>
>> Am 31.03.2015 um 17:44 schrieb Andrew Munn:
>>> No errors or log messages, it just hangs.  I do this on Linux and it works
>>> fine:
>>>
>>> File f1 = new
>>> File("/usr/share/httpd/noindex/css/fonts/Regular/OpenSans-Regular.ttf");
>>> font = PDType0Font.load(document, f1);
>>>
>>>
>>> On Tue, 31 Mar 2015, Tilman Hausherr wrote:
>>>
>>>> What happens if you take the font you're using in linux and use it in
>>>> windows?
>>>> Or are you using one of the standard fonts, if yes, which one? Is any log
>>>> message coming?
>>>>
>>>> Tilman
>>>>
>>>> Am 31.03.2015 um 00:09 schrieb Andrew Munn:
>>>>> This still hangs my app when running on linux:
>>>>> cos.showText("some text");
>>>>>
>>>>>
>>>>> thanks
>>>>>
>>>>>
>>>>> On Mon, 30 Mar 2015, Andrew Munn wrote:
>>>>>
>>>>>> 	
>>>>>> In 2.0.0 what is the preferred way to do this?
>>>>>>
>>>>>> PDPageContentStream cos = ...
>>>>>> cos.moveTextPositionByAmount(x,y);
>>>>>> cos.drawString("some text");
>>>>>>
>>>>>> I see those two methods are both deprecated and the JavaDocs page is
>>>>>> missing.
>>>>>>
>>>>>> Also, my app is hanging at the drawString() method when run on Linux
>>>>>> but
>>>>>> works fine on Windows.  I'm thinking that's maybe font related?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>
> ---------------------------------------------------------------------
> 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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Andrew Munn <an...@nmedia.net>.
Doing something like this was hanging it in Linux.

font = PDType1Font.TIMES_ROMAN
cos.showText(f.fieldName);

In Windows I get:
Exception in thread "main" java.lang.IllegalArgumentException: No glyph 
for U+0064 in font Times-Roman	at 
org.apache.pdfbox.pdmodel.font.PDType1Font.encode(PDType1Font.java:303)
	at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:268)
	at org.apache.pdfbox.pdmodel.PDPageContentStream.showText(PDPageContentStream.java:316)

Thanks


On Tue, 31 Mar 2015, Tilman Hausherr wrote:

> Hi,
> 
> I'd still like to know what happens if you transfer that font to windows.
> 
> If it hangs: open in issue in JIRA and attach the font.
> 
> Tilman
> 
> Am 31.03.2015 um 17:44 schrieb Andrew Munn:
> > No errors or log messages, it just hangs.  I do this on Linux and it works
> > fine:
> > 
> > File f1 = new
> > File("/usr/share/httpd/noindex/css/fonts/Regular/OpenSans-Regular.ttf");
> > font = PDType0Font.load(document, f1);
> > 
> > 
> > On Tue, 31 Mar 2015, Tilman Hausherr wrote:
> > 
> > > What happens if you take the font you're using in linux and use it in
> > > windows?
> > > Or are you using one of the standard fonts, if yes, which one? Is any log
> > > message coming?
> > > 
> > > Tilman
> > > 
> > > Am 31.03.2015 um 00:09 schrieb Andrew Munn:
> > > > This still hangs my app when running on linux:
> > > > cos.showText("some text");
> > > > 
> > > > 
> > > > thanks
> > > > 
> > > > 
> > > > On Mon, 30 Mar 2015, Andrew Munn wrote:
> > > > 
> > > > > 	
> > > > > In 2.0.0 what is the preferred way to do this?
> > > > > 
> > > > > PDPageContentStream cos = ...
> > > > > cos.moveTextPositionByAmount(x,y);
> > > > > cos.drawString("some text");
> > > > > 
> > > > > I see those two methods are both deprecated and the JavaDocs page is
> > > > > missing.
> > > > > 
> > > > > Also, my app is hanging at the drawString() method when run on Linux
> > > > > but
> > > > > works fine on Windows.  I'm thinking that's maybe font related?
> > > > > 
> > > > > Thanks
> > > > > 
> > > > > ---------------------------------------------------------------------
> > > > > 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
> 

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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,

I'd still like to know what happens if you transfer that font to windows.

If it hangs: open in issue in JIRA and attach the font.

Tilman

Am 31.03.2015 um 17:44 schrieb Andrew Munn:
> No errors or log messages, it just hangs.  I do this on Linux and it works
> fine:
>
> File f1 = new File("/usr/share/httpd/noindex/css/fonts/Regular/OpenSans-Regular.ttf");
> font = PDType0Font.load(document, f1);
>
>
> On Tue, 31 Mar 2015, Tilman Hausherr wrote:
>
>> What happens if you take the font you're using in linux and use it in windows?
>> Or are you using one of the standard fonts, if yes, which one? Is any log
>> message coming?
>>
>> Tilman
>>
>> Am 31.03.2015 um 00:09 schrieb Andrew Munn:
>>> This still hangs my app when running on linux:
>>> cos.showText("some text");
>>>
>>>
>>> thanks
>>>
>>>
>>> On Mon, 30 Mar 2015, Andrew Munn wrote:
>>>
>>>> 	
>>>> In 2.0.0 what is the preferred way to do this?
>>>>
>>>> PDPageContentStream cos = ...
>>>> cos.moveTextPositionByAmount(x,y);
>>>> cos.drawString("some text");
>>>>
>>>> I see those two methods are both deprecated and the JavaDocs page is
>>>> missing.
>>>>
>>>> Also, my app is hanging at the drawString() method when run on Linux but
>>>> works fine on Windows.  I'm thinking that's maybe font related?
>>>>
>>>> Thanks
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by John Hewson <jo...@jahewson.com>.
Can you provide the *full* code listing?

— John

> On 31 Mar 2015, at 08:44, Andrew Munn <an...@nmedia.net> wrote:
> 
> No errors or log messages, it just hangs.  I do this on Linux and it works 
> fine:
> 
> File f1 = new File("/usr/share/httpd/noindex/css/fonts/Regular/OpenSans-Regular.ttf");
> font = PDType0Font.load(document, f1);
> 
> 
> On Tue, 31 Mar 2015, Tilman Hausherr wrote:
> 
>> What happens if you take the font you're using in linux and use it in windows?
>> Or are you using one of the standard fonts, if yes, which one? Is any log
>> message coming?
>> 
>> Tilman
>> 
>> Am 31.03.2015 um 00:09 schrieb Andrew Munn:
>>> This still hangs my app when running on linux:
>>> cos.showText("some text");
>>> 
>>> 
>>> thanks
>>> 
>>> 
>>> On Mon, 30 Mar 2015, Andrew Munn wrote:
>>> 
>>>> 	
>>>> In 2.0.0 what is the preferred way to do this?
>>>> 
>>>> PDPageContentStream cos = ...
>>>> cos.moveTextPositionByAmount(x,y);
>>>> cos.drawString("some text");
>>>> 
>>>> I see those two methods are both deprecated and the JavaDocs page is
>>>> missing.
>>>> 
>>>> Also, my app is hanging at the drawString() method when run on Linux but
>>>> works fine on Windows.  I'm thinking that's maybe font related?
>>>> 
>>>> Thanks
>>>> 
>>>> ---------------------------------------------------------------------
>>>> 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
> 


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Andrew Munn <an...@nmedia.net>.
No errors or log messages, it just hangs.  I do this on Linux and it works 
fine:

File f1 = new File("/usr/share/httpd/noindex/css/fonts/Regular/OpenSans-Regular.ttf");
font = PDType0Font.load(document, f1);


On Tue, 31 Mar 2015, Tilman Hausherr wrote:

> What happens if you take the font you're using in linux and use it in windows?
> Or are you using one of the standard fonts, if yes, which one? Is any log
> message coming?
> 
> Tilman
> 
> Am 31.03.2015 um 00:09 schrieb Andrew Munn:
> > This still hangs my app when running on linux:
> > cos.showText("some text");
> > 
> > 
> > thanks
> > 
> > 
> > On Mon, 30 Mar 2015, Andrew Munn wrote:
> > 
> > > 	
> > > In 2.0.0 what is the preferred way to do this?
> > > 
> > > PDPageContentStream cos = ...
> > > cos.moveTextPositionByAmount(x,y);
> > > cos.drawString("some text");
> > > 
> > > I see those two methods are both deprecated and the JavaDocs page is
> > > missing.
> > > 
> > > Also, my app is hanging at the drawString() method when run on Linux but
> > > works fine on Windows.  I'm thinking that's maybe font related?
> > > 
> > > Thanks
> > > 
> > > ---------------------------------------------------------------------
> > > 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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Tilman Hausherr <TH...@t-online.de>.
What happens if you take the font you're using in linux and use it in 
windows? Or are you using one of the standard fonts, if yes, which one? 
Is any log message coming?

Tilman

Am 31.03.2015 um 00:09 schrieb Andrew Munn:
> This still hangs my app when running on linux:
> cos.showText("some text");
>
>
> thanks
>
>
> On Mon, 30 Mar 2015, Andrew Munn wrote:
>
>> 	
>> In 2.0.0 what is the preferred way to do this?
>>
>> PDPageContentStream cos = ...
>> cos.moveTextPositionByAmount(x,y);
>> cos.drawString("some text");
>>
>> I see those two methods are both deprecated and the JavaDocs page is
>> missing.
>>
>> Also, my app is hanging at the drawString() method when run on Linux but
>> works fine on Windows.  I'm thinking that's maybe font related?
>>
>> Thanks
>>
>> ---------------------------------------------------------------------
>> 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


Re: PDFBox 2.0.0 replacement for PDPageContentStream.drawString()?

Posted by Andrew Munn <an...@nmedia.net>.
This still hangs my app when running on linux:
cos.showText("some text");


thanks


On Mon, 30 Mar 2015, Andrew Munn wrote:

> 	
> In 2.0.0 what is the preferred way to do this?
> 
> PDPageContentStream cos = ...
> cos.moveTextPositionByAmount(x,y);
> cos.drawString("some text");
> 
> I see those two methods are both deprecated and the JavaDocs page is 
> missing.
> 
> Also, my app is hanging at the drawString() method when run on Linux but 
> works fine on Windows.  I'm thinking that's maybe font related?
> 
> Thanks
> 
> ---------------------------------------------------------------------
> 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