Hi,
I will create a pdf report that contains a background image like a business logo or a fullpage coporate identity. I used two kind of pdf libs and they both work great with small images, but one PDF page can grow up to 12 MB after inserting an 45kB png image file.
I discovered that a fullpage (A4) background logo file in png of 45kB file size grows to a bitmap of 12,8MB.
Also outside b4a. If I open that png an choose SaveAs *.bmp in any image application the file grows to 12,8Mb . (1785 x 2520 pixels). So bitmap seems to be so big that I want to insert my png without converting to bitmap. Test png image is attached.
Note smaller resolution has a big impact on quality.
In the pdf code I MUST use LoadBitmap, or maybe there is a way to load a png?
At that point my image file is converted to a huge bitmap and it makes the pdf huge also.
Is there any better way to insert a full page image of good quality in a pdf without making that pdf useless for email, because of its file size ?
I will create a pdf report that contains a background image like a business logo or a fullpage coporate identity. I used two kind of pdf libs and they both work great with small images, but one PDF page can grow up to 12 MB after inserting an 45kB png image file.
I discovered that a fullpage (A4) background logo file in png of 45kB file size grows to a bitmap of 12,8MB.
Also outside b4a. If I open that png an choose SaveAs *.bmp in any image application the file grows to 12,8Mb . (1785 x 2520 pixels). So bitmap seems to be so big that I want to insert my png without converting to bitmap. Test png image is attached.
Note smaller resolution has a big impact on quality.
In the pdf code I MUST use LoadBitmap, or maybe there is a way to load a png?
At that point my image file is converted to a huge bitmap and it makes the pdf huge also.
B4X:
Dim bmpLogo As Bitmap
If File.Exists(AppUtils.cstAppFolder, "logoA4.png") = True Then
bmpLogo= LoadBitmap(AppUtils.cstAppFolder, "logoA4.png")
PDFWriter1.addImage2(0,AppUtils.mm2pdf(0),(bmpLogo.width/dblFact),(bmpLogo.Height/dblFact),bmpLogo)
End If
Is there any better way to insert a full page image of good quality in a pdf without making that pdf useless for email, because of its file size ?