Solved PNG Logo in Generated PDF not Printing Clear (1 Viewer)

Weekleyba

Registered User.
Local time
Today, 08:09
Joined
Oct 10, 2013
Messages
586
I have a pdf that is generated with the following code.
The problem I have is the logo in the upper left corner, that I brought in as a png, does not print clearly once the pdf is generated.
If I print it directly from the report, it prints nice a sharp. See comparison below.
Any ideas how to improve this?
The png file is 99 KB.


Code:
Private Sub buttonEmailLetter_Click()

On Error Resume Next

Dim reportName As String
Dim criteria As String
Dim lngResult As String

lngResult = "Hello," & vbCrLf & "This is to inform you that funding has been awarded for the FY22 MIRAC BEMAR projects."
reportName = "GPA_IHS_MIRAC_Funded_Letter_BEMAR_R"
criteria = "[Location_Description] =" & "'" & Me![Location_Descriptions] & "'"

DoCmd.OpenReport reportName, acViewPreview, , criteria, acHidden 'Need to open and close report in order for this to work.
DoCmd.SendObject acSendReport, reportName, acFormatPDF, , , , "IHS FY22 MIRAC BEMAR Project Notification for -   " & _
     "" & Me![Location_Descriptions] & "", lngResult
DoCmd.Close acReport, reportName, acSaveNo

End Sub

1652906976770.png
 

bastanu

AWF VIP
Local time
Today, 06:09
Joined
Apr 13, 2010
Messages
1,401
How does it look if you use Docmd.OutputTo to create a PDF file from the report?

Cheers,
 

strive4peace

AWF VIP
Local time
Today, 08:09
Joined
Apr 3, 2020
Messages
1,003
Is the image stored in Access? or is Access storing the path\file to the image? If you aren't storing path\file (or storing filename and calculating path), then consider doing that! Access converts images and that might be what's causing it to lose resolution.

The Image control will render an external path\file if you set its ControlSource to that, or an expressions that gets that.
 
Last edited:

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 00:09
Joined
Jan 20, 2009
Messages
12,849
Access converts images and that might be what's causing it to lose resolution.
I have a vague memory of a setting that became available with Access 2007, which controlled the storage of images.
 

Minty

AWF VIP
Local time
Today, 13:09
Joined
Jul 26, 2013
Messages
10,354
If you use the following, generally speaking, the output is a lot better quality

DoCmd.OutputTo acReport, sRepName, acFormatPDF, sFullPath, , , , acExportQualityPrint
 

strive4peace

AWF VIP
Local time
Today, 08:09
Joined
Apr 3, 2020
Messages
1,003
yes, Galaxiom, you can change how images are stored in Options. Once converted though, the only way to get what is gone back is to delete and insert again
1653037924104.png
 

Weekleyba

Registered User.
Local time
Today, 08:09
Joined
Oct 10, 2013
Messages
586
Thanks Crystal!
Linking the image resulted is a very clear pdf.
1653053209602.png
 

Users who are viewing this thread

Top Bottom