Images causing Report PDF to be too large (1 Viewer)

Awesomo

Registered User.
Local time
Today, 05:45
Joined
Feb 9, 2016
Messages
45
Hi
I have an Access report which has a page that allows for 6 jpg photographs.
The table has 6 text values, which is the file location of the photographs. The report has 6 Image controls, and I load the picture with this code:

Code:
 For iPhotoNum = 1 To NUM_PICS
            If Me("SubPhoto" & iPhotoNum) <> "" Then
                Me("imgPhoto" & iPhotoNum).Picture = Me("SubPhoto" & iPhotoNum)
             Else
                Me("imgPhoto" & iPhotoNum).Visible = False
            End If
        Next
And all is well.
However, there problems when generating the PDF. (either using the PDF export on the toolbar or through code)
1) In one case there are 3 photographs, each at 1.5Mb each. However the resulting PDF is 44Mb, which is too large for many customers email.

2) Sometimes the PDF is missing the picture. Different case with 4 photos visible in Access, only two photos appeared in the generated PDF.

Both problems are solved by using a "shrunk" copy the original photo. From my testing so far, photos below 500KB do not cause a problem. And bearing in mind that these 6 photos are on the one page, a photo will lower resolution looks just fine.

So I'm wondering is there a way to create a smaller photo through VBA?
In the form where the user selects the photo, I would notify the user that a lower resolution copy was being used.

I'm open to other suggestions as well!
Thanks
 

Awesomo

Registered User.
Local time
Today, 05:45
Joined
Feb 9, 2016
Messages
45
Thanks, but it looks like those solutions relate to using functions in Excel and Powerpoint.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 05:45
Joined
Feb 19, 2013
Messages
16,627
it's vba, the fact it is in excel (or any other office app) is immaterial.
 

Awesomo

Registered User.
Local time
Today, 05:45
Joined
Feb 9, 2016
Messages
45
Sorry, I should have been clearer.
The code in the link is
Application.CommandBars.ExecuteMso "PicturesCompress"

Which won't within Access as the PictureCompress function is not available.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 05:45
Joined
Feb 19, 2013
Messages
16,627
Ah OK.

Not sure what to suggest - there are some threads that suggest rather than using the windows pdf writer, download a free writer (such as CutePDF) and print to that instead (in the same way you would to a printer)
 

Awesomo

Registered User.
Local time
Today, 05:45
Joined
Feb 9, 2016
Messages
45
I have PDF software on my machine, just tried Win2PDF and Adobe Pro.
Unfortunately this produced similar results. I think there will be a problem as long as the users can use any size picture. Some of these think they are artists, and love maximum resolution on their cameras :)
 

Users who are viewing this thread

Top Bottom