Show PDF in report

I want to display .pdf files dynamically, such as images in a report, it should look like this:

enter image description here

I already tried using webbrowser, but then it does not appear in the preview or when I print the report ...

I also tried the ole unbound object, also without success, here is 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 wanted to change the pdf dynamically in the report.

EDIT 2:

I just found out that the OLEunbound object type is built-in, but I think this one should be connected as I read in other forums: enter image description here

When I try to change, it gives an error: "This property cannot be changed because it is read-only"

+5
source share
1 answer

You can get a licensed version of Adobe Acrobat (not Reader) and execute it programmatically to capture the images you need.

Alternatively, you can use the VBA Shell Function to invoke the command line PDF converter, for example, 2Jpeg programmatically (and dynamically, if necessary) convert PDF to image (see this ) or even β€œprint” PDF to an image file using the correct driver (see this ).

Once you have the image file, you can easily load the created image into the Access form using VBA, possibly this .

Without additional information (and answers to my previous questions) I cannot offer more suggestions at this stage, but I hope this helps!

+3
source

Source: https://habr.com/ru/post/1274768/


All Articles