Imagick pdf to jpeg conversion produces low quality image?

I saved a PDF page in acrobat as JPG and it’s 2600x4200 and looks great. I converted the same PDF to jpg and it produces a 600x1000 image that’s not legible. Any ideas what I can do to fix it?


header("Content-Type: image/jpeg");
$Page = new Imagick("document.pdf[0]");
$Page->setCompressionQuality(100);
$Page->setResolution(300,300);
$Page -> setImageFormat('jpeg');
echo $Page;

Edit: I did notice that just outputting the first document page with no conversion results in the same quality, so the conversion isn’t the issue. I wonder if Imagick can deal with PDFs that are this large?

Turns out setResolution needs to be called prior to the document. lol