Hello,
I get a Bitmap from a PDF-page and can it save without ImageEn as Bitmap in a good result. Using ImageEnView (to save it in another format) brings partial error-images:
//This works fine:
//(The result of PdfView1.RenderPage is a Bitmap, created from the displayed PDF-page)
procedure SaveToBitmap;
var
Bitmap: TBitmap;
begin
Bitmap := PdfView1.RenderPage(0, 0, PdfView1.Width, PdfView1.Height, ro0, PdfView1.Options);
//allow only bmp-Filter:
if SaveImageEnDialog1.Execute then begin
try
Bitmap.SaveToFile(SaveImageEnDialog1.FileName);
finally
Bitmap.Free;
end;
end;
end;
This ends in a B/W-image on saving as PNG- or BMP-File; Jpg is OK:
procedure SaveBitmap(Sender: TObject);
var
sExt: String;
begin
//ievPDF is TImageEnView; LegacyBitmap has no influence
ievPDF.Bitmap.Assign(PdfView1.RenderPage(0, 0, PdfView1.Width, PdfView1.Height, ro0, PdfView1.Options));
//here looks still OK:
ievPDF.Update;
if SaveImageEnDialog1.Execute then begin
//nothing:
// sExt := Lowercase(ExtractFileExt(SaveImageEnDialog1.FileName));
// if (sExt = '.png') then begin
// ievPDF.IO.Params.PNG_Filter := ioPNG_FILTER_ALL; //ioPNG_FILTER_NONE; // ioPNG_FILTER_PAETH;
// ievPDF.IO.Params.PNG_Compression := 5;
// end;
try
//nothing ievPDF.RemoveAlphaChannel;
ievPDF.IO.SaveToFile(SaveImageEnDialog1.FileName);
finally
ievPDF.Blank;
end;
end;
end;
What is the reason for it? I'm using IE 7.5.0.
Kind regards,
Jens