Package processing.pdf

Examples of processing.pdf.PGraphicsPDF


      curSlice.renderSilhouette(g);
    }
  }

  public void saveToPDF(PGraphics g) {
    PGraphicsPDF pdf = (PGraphicsPDF) g; // Get the renderer
    for (int i = 0; i < this.getList().size(); i++) {

      SlicePlane curSlice = this.getList().get(i);
      curSlice.render(g);
      pdf.nextPage();
    }

  }
View Full Code Here


  }

  public void saveToPDF(PGraphics g, boolean translate) {

    PGraphicsPDF pdf = (PGraphicsPDF) g; // Get the renderer
    for (int i = 0; i < this.getList().size(); i++) {
      g.pushMatrix();
      g.translate(SETTINGS_SKETCH.chair_width, 20);
      SlicePlane curSlice = this.getList().get(i);
      curSlice.render(g);
      g.popMatrix();
      pdf.nextPage();
    }

  }
View Full Code Here

    this.pages.empty();
  }

  public ByteArrayOutputStream getDXFBuffered(PApplet a) {

    PGraphicsPDF pdf = (PGraphicsPDF) a.createGraphics(
        (int) (this.materialWidth), (int) (this.materialHeight), a.PDF);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    pdf.setOutput(out);

    pdf.beginDraw();
    //pdf.scale(pdf_pixels_per_mm );

    pdf.strokeWeight(.0001f);
    pdf.stroke(255, 0, 0);

    //PFont font = a.createFont("Arial", 8);
    //pdf.textFont(font);

    this.pages.renderPDF(pdf, pdf_pixels_per_mm);
    pdf.dispose();
    pdf.endDraw();

    return out;
  }
View Full Code Here

    return out;
  }

  public ByteArrayOutputStream getPDFBuffered(PApplet a) {

    PGraphicsPDF pdf = (PGraphicsPDF) a.createGraphics(
        (int) (this.materialWidth), (int) (this.materialHeight), a.PDF);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    pdf.setOutput(out);
  //  pdf.textSize(this.textSize);
    pdf.beginDraw();
    //pdf.scale(pdf_pixels_per_mm );

    pdf.strokeWeight(.0001f);
    pdf.stroke(255, 0, 0);
    this.pages.renderPDF(pdf, pdf_pixels_per_mm);
    pdf.dispose();
    pdf.endDraw();
    return out;
  }
View Full Code Here

    dxf.close();
    //dxf.endDraw();
  }

  public void makePDF(PApplet a) {
    PGraphicsPDF pdf = (PGraphicsPDF) a.createGraphics(
        (int) (this.materialWidth),
        (int) (this.materialHeight),
        a.PDF,
        "C:\\MyMedia\\sketchChair\\pdfOutput\\output"
            + functions.getFileName() + ".pdf");
    PFont font = a.createFont("Arial", this.textSize);
    pdf.textFont(font);
    pdf.textSize(this.textSize);

    pdf.beginDraw();
    //pdf.scale(pdf_pixels_per_mm );

    pdf.strokeWeight(.0001f);
    pdf.stroke(255, 0, 0);
    this.pages.renderPDF(pdf, pdf_pixels_per_mm);
    pdf.dispose();
    pdf.endDraw();

  }
View Full Code Here

  }

  public void makePDF(PApplet a, String pdfSaveLocation) {

    PGraphicsPDF pdf = (PGraphicsPDF) a.createGraphics(
        (int) (this.materialWidth * pdf_pixels_per_mm),
        (int) (this.materialHeight * pdf_pixels_per_mm), PConstants.PDF,
        pdfSaveLocation);
   
    LOGGER.info("sending PDF to " + pdfSaveLocation);
    pdf.beginDraw();
    //pdf.scale(pdf_pixels_per_mm);
    pdf.strokeWeight(.0001f);
    pdf.stroke(255, 0, 0);
    //PFont font = a.createFont("Arial", this.textSize);
    //pdf.textFont(font);
    pdf.textSize(this.textSize);
    this.pages.renderPDF(pdf, pdf_pixels_per_mm);
    pdf.dispose();
    pdf.endDraw();
  }
View Full Code Here

    try
    {
      preprocess(t);
      File f = p.outputFile("Save PDF as...");
      p.noLoop();
      PGraphicsPDF canvas = (PGraphicsPDF) p.createGraphics(p.width,
          p.height, PConstants.PDF, f.getAbsolutePath());
      canvas.beginDraw();
      r.render(canvas, 0, 0, canvas.width, canvas.height,true);
      canvas.endDraw();
      canvas.dispose();
      // canvas.save(f.getAbsolutePath());
    } catch (RuntimeException e)
    {
      e.printStackTrace();
    } finally
View Full Code Here

TOP

Related Classes of processing.pdf.PGraphicsPDF

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.