|
Hi,
Can anyone guide me on how to do the following cenerio:
I have a table:
ID type int
Data type image
Now on a form in vb.net, I drop the control data field as a picturebox.
I want to double click on the picturebox to load a pdf file so that i can store in the table.
a button to view the pdf file.
I tried to do it as a simple picturebox for gif, etc.. it does not work.
the idea behind this is to be able to store the pdf in a table as normally do for a picture.
Also once I acheive this, i would like to view the pdf file.
I would appreciate if anyone can send the code to do this. even if it is not with my approach but the same result.
Thanks a lot.
|
|
|
|
|
Since a PictureBox control knows nothing about the PDF file format, it can't render one at all.
You'll have to use another control, such as PdfSharp or some other PDF Viewing control.
|
|
|
|
|
thanks for your response.
I load the pdf file into webbrowser control. Now i need to save into a table. the form in question already has a dataset binding into it. I neesd to take the pdf file that's showing in the webbrowser control and to be saved with every control on the form.
Here the code below that I used:
Dim Response As DialogResult
OpenFileDialog1.FileName = ""
OpenFileDialog1.Filter = "PDF Files(*.pdf)|*.pdf|All Files(*.*)|*.*"
Response = OpenFileDialog1.ShowDialog()
If Response <> Windows.Forms.DialogResult.Cancel Then
If OpenFileDialog1.FileName <> "" Then
cmdBrowse.Navigate(OpenFileDialog1.FileName)
End If
End If
i have a table name ManifestTD with dataset ManifestTD_dataset with column (ID as PK, Data as Binary(MAX)
How to get this save into the table ; also be able to doubleclick to the webbrowser command to view the entire pdf document through adobe
Thanks again.
|
|
|
|
|
You can save the contents of the PDF file to the database the exact same way you save any other image format. Like this[^] or this[^].
|
|
|
|