jdf / Processing.py-Bugs

A home for all bugs and feature requests about Python Mode for the Processing Development Environment.
41 stars 8 forks source link

import PDF library in linux does not work #247

Closed dalanicolai closed 5 years ago

dalanicolai commented 5 years ago

On linux (Fedora 28). When I try to export to pdf (see example file) in Processing 3.4 I get the following error message:

You need to use "Import Library" to add processing.pdf.PGraphicsPDF to your sketch.

I added the pdf import statement via the Import Library in de Sketch menu as can be seen in the attached example file (that produces the error. changed extension from pyde to txt so that github accepts it as attachmnet)

pdfTest.txt

jansindl3r commented 5 years ago

I have the same problem on Windows 7, any solution yet?

jdf commented 5 years ago

I have found that, as with the examples in the main Processing mode, you must declare your PDF output in setup. This program works for me:

add_library('pdf')

def setup():
    size(400, 400, PDF, "/tmp/out.pdf")

def draw():
    ellipse(200, 200, 50, 50)
    exit()