Convert PDF pages to PNG images.
var $file : 4D.File
$file:=File("/RESOURCES/4Dv20_LTS_brochure_English.pdf")
var $images : Collection
$images:=pdf to image($file)
$i:=0
For each ($image; $images)
$i+=1
WRITE PICTURE FILE(Folder(fk desktop folder).platformPath+["page"; $i; ".png"].join(""); $image)
End for each
[!TIP] The default DPI is
72. Pass in$2{dpi:144}for example, to scale the output by2x.
[!TIP] You can now pass a hex value like
0x00000000ornoneto set the background fill colour:$images:=pdf to image($file; New object("dpi"; 300; "background"; "none"))