Solved

Need Access to generate smaller PDF

Posted on 2011-02-24
10
642 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
Comment Utility
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
Comment Utility
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
Comment Utility
...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
 

Author Comment

by:Cole100
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 21

Assisted Solution

by:Boyd (HiTechCoach) Trimmell, Microsoft Access MVP
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 62 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Then you may have to think about compressing (zipping) the files first...
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
...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
Comment Utility
TheHiTechCoach,

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

Jeff
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now