I'm receiving a PDF from an api, and the resolution is 429x643mm - I need a document that's 100 x 150 approx instead, which means I need to divide the length and height by about 4.24 or 4.25.
I'm not trying to change the file size, I'm not concerned with the resolution of any images inside, I just want to change the resolution in a non-destructive way, using PHP. I can use imagick, but I'm concerned after some googling that imagick will rasterize the entire pdf if I try to change resolution, which would be not ideal.
I've looked through stackoverflow but couldn't find anything like this question before, so I'm hoping I can find somebody who's done something like this before.
You're not trying to change the resolution of the PDF; a PDF doesn't have a resolution. You're trying to scale the pages in the PDF.
There are two ways to do this in general:
Rewrite the page content, recalculating the positions and sizes of all objects in the page content. Then also recalculate the positions and sizes of the different page boxes in the /Page element for each page.
Insert a /UserUnits key in the /Page element. This has the effect to scale the page (either up or down), if supported by the printer (which it should be, but well, compliance to standards...).
So you either need a tool that can scale the whole page for you, or one that can insert an additional key in the page dictionary of each page of the PDF file.
Not a full answer, but with this you may have a better chance to find a tool or code to do what you need to do. There are definitely libraries out there that can do either of these things.