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 › wondering about PDF export..
Page Index Toggle Pages: 1
wondering about PDF export.. (Read 652 times)
wondering about PDF export..
Sep 28th, 2007, 10:10am
 
hi, everyone

when i use PDF export function, (http://processing.org/learning/libraries/oneframe.html)
it seems that the picture has been anti-aliased, or a bit blured(?) automatically. it feels like a screen shot..

is it normal?

for example, the edges of my squares are all rounded very clean...
Quote:


import processing.pdf.*;

size(500, 500);
beginRecord(PDF, "line.pdf");
background(255);
//stroke (255);

strokeWeight(1);
strokeCap(PROJECT);
//number of shapes in colunms and rows
int cols = 5;
int rows = 5;
//value of white spaces in col and rows?
//negative value makes it inversed, becuase there's no space between lines
int xPadding = 100;
int yPadding = 100;
//initialize the x, y postion for the lines
float w = (width-xPadding)/cols;
float h = (height-yPadding)/rows;
//initialize the left, right spaces between shapes
float colSpan = (width-cols*w)/(cols+1);
float rowSpan = (height-rows*h)/(rows+1);

float x=colSpan;

float y;
for (int i = 0; i<rows; i++){
 //why initialize x value here?? x has to repeat and y not???
 y = rowSpan;
 
 for (int j = 0; j<cols; j++){
 
   //first two value x, y is the initial position of the first shape
   //why initial y value is declared outside of the loop??
   line(x, y, x+w, y);
   line(x+w, y, x+w, y+h);
   line(x+w, y+h, x, y+h);
   line(x, y+h, x, y);
   y += h+rowSpan;
   
 }
 //if i delete this, only one rows drawing
x+=w+colSpan;
}
endRecord();
//either col or rows has to be initial value for other to repeat the whole structure




how this PDF export function works really?
there's a lose of quality in any sort?
do you guys use this function for print?
i saw some printed materials done by Processing and the quality was super, (one of REAS stuff.) is he using this function to export his works then print?

many thanks,
Re: wondering about PDF export..
Reply #1 - Sep 28th, 2007, 10:35am
 
Hi,

If you open the exported PDF in Preview on OS X, you should disable the Anti-aliasing option in Preview's preferences > PDF tab > Anti-alias text and line art.

can you confirm it ? Smiley
Re: wondering about PDF export..
Reply #2 - Sep 28th, 2007, 10:41am
 
thank you for quick reply...and yes!
it removes anti-alias.
but it still cleans up line edges.. (which is a good thing for me, for now.)

do you use this function to print your creations?
Re: wondering about PDF export..
Reply #3 - Sep 28th, 2007, 11:14am
 
I'm not really using P5 for exporting PDF, more about video stuff. Smiley

For a few things i had to export in PDF, i can say that i'm satisfied with the exported quality. Wink
Re: wondering about PDF export..
Reply #4 - Sep 28th, 2007, 4:21pm
 
Hi,

I'm actually exploring the print area of processing too and i've a question not really directly related with processing, but with print guideline.

I want to print a document with a particular size (220mm width * 110 mm height), but knowing that i'm just wondering what the size of my sketch should be.

I've try different new document settings with photoshop to get an idea and seems really related to the dpi resolution.

So how to convert a size of a real document into a processing size being sure u'll have a good quality ?

This export feature is amazing !
Re: wondering about PDF export..
Reply #5 - Sep 28th, 2007, 4:49pm
 
You can take 72dpi and work backwards from there.  Or use toxi's code that allows you to specify a page size instead of screen size, which then sets screen size accordingly for you, see his blog entry: http://toxi.co.uk/blog/2007/07/specifying-pdf-page-size-in-processing.htm
Re: wondering about PDF export..
Reply #6 - Sep 28th, 2007, 5:12pm
 
Thanks a lot dave !!
Page Index Toggle Pages: 1