Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
GA334
Posted - Feb 09 2025 : 13:38:51 Hi All -
I have a PDF with ~5k pages. What I need to do is load the PDF and search each page's data, (for creating a filename) and then copy the page out to a tiff file. There will be ~ 5k TIF files when done.
I was thinking of using ImageEnView.PDfViewer but I can't figure out how to save a page to a TIF file...
the output is too blurry for reading the fine print on the page. (The PDF contains forms with pretty small type)
Previously I have used Universal Document Converter Print-Driver to 'print' to a tiff file and the output is crisp and filesize for each page is only ~ 42k. Using ioTIFF_LZW the output size is 250k and ioTIFF_JPEG is 144k
Any suggestions?
Thanks again! GA
xequte
Posted - Feb 09 2025 : 18:03:24 Hi
You can do it as follows:
// Save all pages of PDF to Jpeg
ImageEnView1.PdfViewer.Enabled := True;
ImageEnView1.IO.LoadFromFile( filename );
for i := 0 to ImageEnView1.PdfViewer.PageCount - 1 do
begin
ImageEnView1.PdfViewer.PageIndex := i;
ImageEnView1.IO.SaveToFile( 'D:\' + ExtractFilename( ChangeFileExt( filename, '_' + IntToStr( i + 1 ) + '.jpg' )));
end;