Solved

Need Access to generate smaller PDF

Posted on 2011-02-24
10
683 Views
Last Modified: 2012-06-22
I have a module generating and attaching my reports to email. I have just upgraded from 2007 to 2010 (Acrobat 9 to Acrobat X) and my PDF size has gone from 300K to 800K. I need the file to be under 500K. I can manually export to a smaller PDF but through the module it just will not work. Any idea's? Thanks (See module code below)
Function send_emailcap_mtd()
   On Error GoTo Err_Send_Click
 
    Dim mydb As Database, RS As Recordset
    Set mydb = DBEngine.Workspaces(0).Databases(0)
    Dim attachPDF As String
    Dim docname As String, ctl As Control, strTo As String
    Dim path As String, subject As String, body As String
    Dim attach As String, blnSuccessful As Boolean
         
     Application.Echo False
    
    Set RS = mydb.OpenRecordset("qry_emailcap_mtd")
        
    path = "c:\temp\"
    docname = "emailcap_mtd"
    attachPDF = path + docname & ".pdf"
    subject = "Email Address Capture Report"
    body = "Daily Report is Attached"
    DoCmd.OutputTo acOutputReport, docname, acFormatPDF, attachPDF
 
 Do Until RS.EOF
      strTo = RS!Email
       blnSuccessful = FnSafeSendEmail(strTo, subject, body, attachPDF, "", "")
       RS.MoveNext
    Loop
    RS.Close
    Set RS = Nothing
    Set mydb = Nothing
 
exit_send_click:
     
    Application.Echo True
    Exit Function
 
Err_Send_Click:
    Resume exit_send_click
     
End Function

Open in new window

0
Comment
Question by:Cole100
  • 5
  • 2
  • 2
  • +1
10 Comments
 

Expert Comment

by:jameslaws
ID: 34976194
I haven't personally played with Acrobat X yet, but if there is a way for you to set an option to save PDF in the Acrobat 9 format as a default. If not check Acrobat X to see if there is a way to set compression rates to maximum as a default.
0
 
LVL 21

Assisted Solution

by:Boyd (HiTechCoach) Trimmell, Microsoft Access MVP
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 62 total points
ID: 34976782
Since you are using this code:

DoCmd.OutputTo acOutputReport, docname, acFormatPDF, attachPDF

Open in new window


would indicate that you are not using Adobe Acrobat to create the PDF but the built in PDF feature in Access.  Is this correct?

In my test with Access 2007 and 2010  PDF  using the built in PDF tool the files were the same size.

have you made any changes to the report design recently?



 
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 63 total points
ID: 34980438
...or is the report simply displaying different number of records?

For example:
Your first report was of sales in Tuvalu (6 records), and the second Report was Sales in China (60,000 records)
;-)

Jeff
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:Cole100
ID: 35021051
I am using access' built it PDF converter. With Access 2007 I was using a 3rd party converter so I would imagine that would have an effect. The 3rd party converter I was using does not work for 2010. Otherwise the report itself is exactly the same. I do not see anywhere in access to change compression of the PDF.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 63 total points
ID: 35021438
Then I am not sure.

1. Why must the size be below 500k?
There may come a time when the PDF format just may not produce files small enough anymore.

I mean, I would always stick with any built in utility.  In the overall scale of file sizes, 500k to 800k is not that big of a deal in most cases.

2. If the increases in file size is really intolerable, you may want to check with the manufacturer of your 3rd party vendor for an update for 2010.

(But be warned that since Office now includes a PDF utility, may of these small apps might no longer be issuing updates...)

Again, what is the story behind the 500k hard limit?

JeffCoachman
0
 
LVL 21

Assisted Solution

by:Boyd (HiTechCoach) Trimmell, Microsoft Access MVP
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 62 total points
ID: 35028705
I have just learned from an Word MVP that a PDF show now include  tagges so that screen readers can readt the file for accessibility complaiance. My understanding is that Microsoft must make sure thier PDF output is compliant. Thus the file size will increase.

This new accessibility complaiance will be an issue for all third-party vendors that make PDF writers. So I expect the PDF will size to increase accross the board.

0
 

Author Comment

by:Cole100
ID: 35029691
The third party vendor I was using does not support 2010 and I am not having much luck finding anything else. The built in PDF generater works great other than the file size issue. Based on my research I am beginnning to think PDF will only increase in the future. (In the world of superfast internet speeds and multi-GB jump drives then why not)

The 500k limit is because my stores are on a VPN (which I have no control over) and they limit the email attachment size.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35030345
Then you may have to think about compressing (zipping) the files first...
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35030384
...or ask the powers that be to increase the email attachment size.

I mean, most files (Formats) will only get bigger and bigger with time.
So this hard limit will only become more and more annoying...

In other words, ...endeavor to solve the problem (easy), instead of "Working around it" (More difficult)
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35030403
TheHiTechCoach,

Thanks for the update on the PDF format..
;-)

Jeff
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question