# Change the output location of beginRecord?

**URL:** <https://discourse.processing.org/t/change-the-output-location-of-beginrecord/3643>\
**Category:** Coding Questions\
**Created:** [September 18, 2018, 2:56pm UTC](https://discourse.processing.org/t/change-the-output-location-of-beginrecord/3643 "2018-09-18T14:56:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cam](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@Cam](https://discourse.processing.org/u/Cam)\
**Post date:** [September 18, 2018, 2:56pm UTC](https://discourse.processing.org/t/change-the-output-location-of-beginrecord/3643/1 "2018-09-18T14:56:32Z")

</div>

```auto
import processing.pdf.*;

class secondWindow extends PApplet {
  secondWindow() {
    super();
    PApplet.runSketch(new String[] {this.getClass().getSimpleName()}, this);
  }
  void settings() {
    size(100, 100);
  }
  void setup() {
    beginRecord(PDF, "output/example.pdf");
    endRecord();
  }
}

void setup() {
  secondWindow a = new secondWindow();
}

```

This will result in error message stating:

`Can't save the PDF file to /private/var/folders/5k/7mr92p894cldzgn7dfqbp10cp8yl14/T/AppTranslocation/84E3594D-F94C-47DB-8D84-655323E9A2CB/d/output/example.pdf`

Putting that address into the search bar of chrome brings me into the directory of Proccessing.app leading me to believe that the app is trying to save the pdf into the App itself?

Assuming the sketch folder is named test, how could I make this program save `example.pdf` to `test/output/`?

* * *

Alternatively, is there any way to find the resolution of the computer running the program from within the program? It would be more beneficial for me to find a solution to the original problem, but I could get the program working with this too.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [September 18, 2018, 3:03pm UTC](https://discourse.processing.org/t/change-the-output-location-of-beginrecord/3643/2 "2018-09-18T15:03:30Z")

</div>

> [@Using custom \`main(String\[\] args)\` breaks file reading functions in Windows (e.g. \`loadShader()\`, \`loadImage()\`)](https://discourse.processing.org/t/using-custom-main-string-args-breaks-file-reading-functions-in-windows-e-g-loadshader-loadimage/2572/14):
>
> By default, field PApplet::sketchPath would point to the “Current Working Directory” (CWD): Unless a special “–sketch-path=” argument is passed to PApplet.runSketch(): [Forum.Processing.org/two/discussion/16457/size-method-for-intial-window-not-working-when-more-windows-are-are-added#Item\_1](http://Forum.Processing.org/two/discussion/16457/size-method-for-intial-window-not-working-when-more-windows-are-are-added#Item_1) I believe the PDE (Processing’s IDE) creates its own customized main(String[] args) which passes all of those custom args to the compiled sketch. And when we override it by making our own main(String[…

> [@Plot grafica in Pgraphics?](https://discourse.processing.org/t/plot-grafica-in-pgraphics/2334/2):
>
> Seems like the library grafica doesn’t offer us any option to change the PGraphics it draws onto. It directly calls PApplet’s methods to draw on its canvas. disappointed The workaround I’ve come up w/ is to wrap up the grafica’s code on its own PApplet subclass. gift And then call PSurface::setVisible() in order to hide its window. dark_sunglasses And in order to save its current canvas, I’ve added a pre() method to it: void pre() { unregisterMethod("pre", this); saveFrame(dataPat…

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [September 18, 2018, 3:10pm UTC](https://discourse.processing.org/t/change-the-output-location-of-beginrecord/3643/3 "2018-09-18T15:10:06Z")

</div>

> [@Cam](#):
>
> … is there any way to find the resolution of the computer running the program from within the program?

System variables _displayWidth_ & _displayHeight_: 💻

- [Tagged with displaywidth - Processing 2.x and 3.x Forum](http://Forum.Processing.org/two/discussions/tagged/displaywidth)
