# PDF of P3D Processing sketch

**URL:** <https://discourse.processing.org/t/pdf-of-p3d-processing-sketch/39996>\
**Category:** Coding Questions\
**Created:** [December 2, 2022, 8:52pm UTC](https://discourse.processing.org/t/pdf-of-p3d-processing-sketch/39996 "2022-12-02T20:52:10Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [December 3, 2022, 8:41pm UTC](https://discourse.processing.org/t/pdf-of-p3d-processing-sketch/39996/17 "2022-12-03T20:41:06Z")

</div>

> [@asymmetric](#):
>
> the PDF files have a white background instead of black

I am not an expert on this library.

Searching the forum I found this:

> [@PDF export won't save with background for my 3d sketch](https://discourse.processing.org/t/pdf-export-wont-save-with-background-for-my-3d-sketch/10460):
>
> I have read the Processing docs on PDF export for 3d sketches. For some reason, my sketch won’t save as a PDF with the specified background. It only saves on a white background. //Stuff for saving stage import processing.pdf.\*; // global variables int DIM = 500; // height, width int N = 20; // n squares down and up int R = int(DIM/N); // radius of squares // setup drawing void setup(){ size(500, 500, P3D); rectMode(CENTER); noFill(); noLoop(); stroke(100, 100, 0); } // draw void …

You could also go here and do a search you will get more results:  
[https://processing.org/](https://processing.org/)

If you provide a [MCVE](https://stackoverflow.com/help/minimal-reproducible-example) the community can run your code and may be able to help. An MCVE is mentioned in [Guidelines - Asking Questions](https://discourse.processing.org/t/guidelines-asking-questions/2147/1).

You can still get some nice effects without using P2D or P3D and get your background.

This is from the PDF:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/7/8/78d548a87f57b2877dc0530080b523c32ae81246.png)

Remove anything that has a z component from code:

`translate (x * noiseFactor * 6, y * noiseFactor * 6);`

You may lose some perspective but it seems you are modifying size of ellipse already.

`:)`

---

_[View the full topic](https://discourse.processing.org/t/pdf-of-p3d-processing-sketch/39996)._
