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 & HelpSyntax Questions › [HELP] Set the correct size for PRINTING
Page Index Toggle Pages: 1
[HELP] Set the correct size for PRINTING (Read 473 times)
[HELP] Set the correct size for PRINTING
May 7th, 2008, 1:03pm
 
Hello :)
Currently I'm using processing to develop an application that will build a "processed book". The pages will be programmatically drawn.

I will output to PDF via the pdf exporter.

I NEED TO KNOW WHAT SHOULD I SET AS size(width, height) IN ORDER TO PRINT AT 300dpi.

Or better: do you know what's the relation between the screen size and the required size to print at a given resolution?


PS: please use millimeters to make calculations :)
Re: [HELP] Set the correct size for PRINTING
Reply #1 - May 7th, 2008, 1:38pm
 
Unfortunately it's not so simple.

If you're drawing lines/ellipses/text (in vector mode) etc, then the size is fairly irrelevant, since it'll scale perfectly, you just need to get the right ratio of width/height to match the page you're using, and Acrobat should take care of rendering it at 300dpi to send to the printer.

If however you're doing pixel work, then you need to calculate the number of pixels required to fit the page at 300dpi.. (why use DPI if you want to calculate in mm??)

Basically, take the width in whatever units, and multiply by the dots per that unit, and that's your number of pixels in that dimension... e.g. for A4 paper: width=210mm so that's 210mm*12dpmm = 2520 pixels wide.

(300dpi = 12dpmm apparently)
Re: [HELP] Set the correct size for PRINTING
Reply #2 - May 7th, 2008, 1:45pm
 
Great. I guessed that but I wasn't sure that rect() ellipse() etc would render as vector graphics.

WHAT I REALLY DONT KNOW IS: how do fonts get rendered?
I mean if for a 210x297mm paper I do a 210x297px screen and just draw vector graphics, everything is fine... as when printing the PDF document it will scale to match the paper and the graphics, since it's vector, will just scale fine. But what happens with characters? Are they considered as vector either?
Re: [HELP] Set the correct size for PRINTING
Reply #3 - May 7th, 2008, 2:10pm
 
I think if you use createFont("Verdana",14); or similar to get your font, then they will be vector fonts, not bitmap ones.
Re: [HELP] Set the correct size for PRINTING
Reply #4 - May 7th, 2008, 3:37pm
 
http://www.toxi.co.uk/blog/2007/07/specifying-pdf-page-size-in-processing.htm
Page Index Toggle Pages: 1