0

I have a form / report that I need to get images to display on, but they are all received in PDF format which the attachment control can't display.

To get around this I was planning on using the Adobe PDF activex control, but I can't just pass it a file path since this database will be used for reporting by people that do not have access to the network shares these PDF files will be on.

Ideally I would like to store the file in the database and then pass this stored version into the control. I am having trouble finding documentation on what I can do with the adobe pdf control.

I am imaginging something like:

AcroPDF1.LoadFile (Me.attachment)

Is this possible?

Geoff
  • 5
  • 2
  • I suspect that the `.LoadFile` method of the ActiveX control object only accepts an argument that is a String representing the path to a PDF file. If the control does not have some other method that can accept the file data in some other form, e.g., an array of bytes, then you'll have to save the attachment to a temporary file using the `.SaveToFile` method of an ACE DAO `Field2` object (example [here](http://stackoverflow.com/a/25867795/2144390)), and then give the ActiveX control's `.LoadFile` method the path to the temporary file. – Gord Thompson Mar 13 '15 at 21:38
  • Thanks for the reply. We have decided to restrict the DB to attaching small jpegs to limit the size, so the issue has disappeared! – Geoff Mar 17 '15 at 14:05

1 Answers1

0

What you need a database-linked PDF viewer.

Delphi: http://www.gnostice.com/nl_article.asp?id=274&t=Data_aware_VCL_component_to_display_DOCX_PDF_BMP_PNG_JPEG_from_a_database

.NET: http://www.gnostice.com/nl_article.asp?id=279&t=How_to_save_and_retrieve_PDF_documents_to_and_from_a_database_using_C

You will have to modify the data source with a network DB.

gn1
  • 526
  • 2
  • 5