PDF library is only exporting corner of image

Hi! My goal is to make a high resolution PDF of my processing sketch so I can print it large. When using the following PDF library I am only getting a portion of the sketch. Why is this? My sketch is size(900, 900);

import processing.pdf.*;
void setup() {
  size(400, 400, PDF, "filename.pdf");
}
void draw() {
// Draw something good here line(0, 0, width/2, height);
  // Exit the program
  println("Finished.");
exit(); }

This is the output:

I figure it out! After I removed pixelDensity(2); the sketch successfully exported!