I have a PDF file which I would like to convert to a png format and create everything white as transparent on there. Along with this I also need to resize the original file size by a specific value and make it high quality. Sounds like a lot i know. I put the -fuzz command thinking that it allows for not perfect white in the background to still be detected as white. Is this correct about the fuzz function
Basically i have a PDF in CMYK format 300 DPI.
I need to scale the PNG by 2.2 x original PDF size in 300 DPI
So if PDF is 3x4 I need the png to be 6.6x8.8
So far here is my code
Code: Select all
exec('convert -density 300 -colorspace rgb {$pdf_file}' -channel rgba -fuzz 600 -transparent "#ffffff" {$png_file});
This works great with the transparency and the quality but the size is completely off. I have tried putting in the -resample command but it just makes it way too big.
Is there a way to keep the quality high and be able to have the png at a specific size ?
Please help