We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Export text to .PDF file problem with the .PDF lib
Page Index Toggle Pages: 1
Export text to .PDF file problem with the .PDF lib (Read 1002 times)
Export text to .PDF file problem with the .PDF lib
Aug 14th, 2009, 10:03am
 
I have some trouble getting text to show up on exported .PDF files. They appear as solid color blocks. I also searched the .PDF file and couldn't find the text from the search function. Apparently the text was turned into images. I'm ok with it. But how do I fix this? Thanks. The following is the code:
   beginRecord(PDF,"output.pdf");
   myFont=loadFont("ArialMT-16.vlw");
   textFont(myFont,16);
   text(blah, x,y);
   endRecord();
How do I attach an image to this topic?  Embarrassed

BTW, I'm using the Processing's default render. When I use OPENGL, it works but very slowly considering my laptop is a C2D with 4GB ram and the code is nothing fancy. I did get the text but not the right size, slightly smaller than the textWidth() reports, which I use to draw a border for the text.
Re: Export text to .PDF file problem with the .PDF lib
Reply #1 - Aug 15th, 2009, 7:36am
 
similar problem http://processing.org/discourse/yabb2/?num=1203516711
Re: Export text to .PDF file problem with the .PDF lib
Reply #2 - Aug 15th, 2009, 4:26pm
 
Thanks Cetric. The solution seems more complicated than what I wanted. I'll stick with save() to save as .PNG since it's not too bad at all.
Re: Export text to .PDF file problem with the .PDF lib
Reply #3 - Aug 16th, 2009, 12:05pm
 
You could try hint(ENABLE_NATIVE_FONTS); together with createFont(...) instead of loadFont().
Page Index Toggle Pages: 1