Reducing PDF output size? (1 Viewer)

A1ex037

Registered User.
Local time
Today, 04:04
Joined
Feb 10, 2018
Messages
41
It seems that, when generating PDF with DoCmd.Output to command, PDF file gets unusually big. This is what I am using now:

DoCmd.OpenReport "Report", acPreview, , "[ID]= forms![frmGenerate]![ID]", acHidden
DoCmd.OutputTo acOutputReport, "report", acFormatPDF, filePath, True

Current PDF file is around 1MB. If the same file gets generated manualy, with "print to pdf" directly from report page, file size us around 200kb. I have read that DoCmd.OutputTo acOutputReport generates file with everything embedded, fonts gets multiplied, etc. Is there any way to get the PDF file smaller. I couldn't find anything related to PDF (similar question has been asked here.

Cheers.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 19:04
Joined
Oct 29, 2018
Messages
13,692
Hi. Not sure if this will answer your question, or if it will even have any difference; but, you don't have to open the report first, albeit in hidden mode, before you output it to PDF. So, try commenting out the first line in your code and see if simply using the OutputTo command, without using the OpenReport command first, would make any difference.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:04
Joined
Aug 30, 2003
Messages
34,811
you don't have to open the report first

You do if you want it filtered by the wherecondition. ;)
 

MickJav

It wasn't me
Local time
Today, 03:04
Joined
Nov 28, 2005
Messages
2,333
You could add the where to a query so It was limited to forms![frmGenerate]![ID]
 

A1ex037

Registered User.
Local time
Today, 04:04
Joined
Feb 10, 2018
Messages
41
Yes, it was created a long time ago, and as I recall, there are plenty of things behind that forced me to use DoCmd.OpenReport .
Any ideas about reducing PDF file size?
 

Users who are viewing this thread

Top Bottom