I want to display dynamically .pdf files like pictures in a report, it should look like this:
i already tried with webbrowser, but then it doesn't show up in the preview or when i print the report out...
I also tried a ole unbound object, also no success, here the code i had in the Report_Load
event:
Dim vPath As String
vPath = GetNewestDocument(Me!artNr)
'Returns path for pdf file, about:blank if there is no file.
If vPath = "about:blank" Then
Me!PDFBrowser.visible = True
Me.PDFBrowser.SourceDoc = vbNullString
Else
With Me.PDFBrowser
.OLETypeAllowed = acOLELinked
.SourceDoc = vPath
.SizeMode = acOLESizeStretch
End With
End If
EDIT:
With "I want to display dynamically ..." i meant to change dynamically pdf's in the Report.
EDIT 2:
I just found out that the type of the OLEunbound object is embedded, but i think this one should be linked as i read in other Forums:
When i try to Change it gives error: "This property can not be changed because it is read-only"
You could get a licensed version of Adobe Acrobat (not Reader) and control it programmatically to capture the images you want.
Alternatively, you could use the VBA Shell Function
to call a command-line PDF converter like 2Jpeg to programmatically (and dynamically if necessary) convert the PDF to an image (see this), or even "print" the PDF to an image file using the correct driver (see this).
Once you have an image file, you can easily load the created image to your Access form with VBA, perhaps with this.
Without further information (and answers to my previous questions) I can't offer more suggestions at this point but I hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With