Hi, I got a project to load a pdf into a picturebox in vb6.
How do I handle that? Is there anyone who sell that .ocx? is there anyway to do it?
Thanks

Recommended Answers

All 12 Replies

Well a picture box is meant to hold graphics while the adobe acrobat 7.0 browser control type library 1.0 will allow you display pdf files... So are you wanting to put this control into a picture box, or are you wanting to use one of those print to Tiff drivers to print the adobe pdf via the shellexecute API with the "print" verb and then use WIA 2.0 to load and display the output in a picture box???

Good Luck

thanks for the info. Anything will do.
I don't need to do anything with the picture.
I just need to use it in "loadpicture" picture function and display it.
Which way do you thing is the easiest?
thanks a lot, it's relieve to know that it is possible

thanks for the info. Anything will do.
I don't need to do anything with the picture.
I just need to use it in "loadpicture" picture function and display it.
Which way do you thing is the easiest?
thanks a lot, it's relieve to know that it is possible

Graphics formats recognized by Visual Basic include bitmap (.bmp) files, icon (.ico) files, cursor (.cur) files, run-length encoded (.rle) files, metafile (.wmf) files, enhanced metafiles (.emf), GIF (.gif) files, and JPEG (.jpg) files(MSDN).

Looks like you have to convert the pdf file first into a format that's supported by the LoadPicture method , like vb5 said.

So, download a utility like he said and use the one of the Shell functions from VB6 or the Windows API to execute the utility to put the pdf into a jpeg. Then once that's done, you should have a converted jpeg file on your system that you can use in the LoadPicture method.

adobe acrobat 7.0 browser control type library 1.0 will allow you display pdf files... I have got it and added into my project reference and I am wanting to put this control into a picture box.

But how do I do it? thanks

Place picture box on form, size it, select control from toolbox, and draw it into the picture box.

Good Luck

wow, good stuff
But, I just want to get the picture. so pretty much I need the page display of that pdf.
Do you what property should I use?
I have tried using .print property but it doesn't work (or maybe I am the one who didn't know how to use it). thanks

wow, good stuff
But, I just want to get the picture. so pretty much I need the page display of that pdf.
Do you what property should I use?
I have tried using .print property but it doesn't work (or maybe I am the one who didn't know how to use it). thanks

Like VB5 said, "Put a control on the form."

Click on the toolbar and add a component: Adobe Acrobat 7.0 Browser Control Type library 1.0

And then you have to set the properties and methods correctly to load a document. You can do this from a menu or in the Load of the form.

With AcroPDF1
         .Container = Frame1  ' or PictureBox1, etc.
         .LoadFile "D:\Documents and Settings\Joe User\My Documents\MyNew.pdf"
         .gotoFirstPage
         .Move 10, 10, Frame1.Width - 10, Frame1.Height - 10
         .setPageMode ("none")
        .Visible = True
         
End With

That should show it. You probably will have to mess with the resize event to resize the frame or the picture box when the form is resized.

If you want just the picture then search the web for print to tiff or tiff printer driver. Set it up on your computer and print the pdf to either a multipage or many single page tiffs. (Those configurations will be found in the documentation of the tiff driver.) Either use the control or the shellexecute API with the "print" verb or do it manually. Go to M$ and download (if you need to) the WIA 2.0 SDK. You will need this to be able to load a tiff image into a picture box on win xp systems and later. If on 2k or earlier you can use the wang/kodak imaging controls.

Good Luck

thanks vb5prgmr and hkdani for your very generous help, after looking around for tiff driver in the web. from my understanding, tiff driver is a separate software that needs to be manually operated.

my goal is to be able to load .pdf's picture into a picturebox by specifying its file location. will it be possible?

it might be possible to specify a picturebox as acropdf's container, just like hkdani told me. but it is overkill for me, it has its own tab to change the pages, add the comment and attachment. furthermore, it can zoom in and zoom out. I don't want those methods, how can I turn it of?

sorry for keep disturbing you about this matters... I am confuse..
thanks

I don't know where you found your information that printing to tiff is a sepeate piece of software that you need to operate, because my searches "windows print to tiff" and "tiff print driver" both found tiff printer drivers for windows that "ANY" software can print to just as if it were a HP or lexmark printer...

and yes it is possible...

1st) Download and setup tiff printer driver and make it the default printer driver..
2nd) shellexecute API with "print" verb the *.pdf file in question
3rd) Download and setup if needed WIA 2.0
4th) Use WIA 2.0 to open and display tiff image in picture box

Good Luck

Thanks vb5prgmr, solved :) thanks a lot

Hi,

I found the tip very helpful and I would have an other question:

how can I save the picture (just the container) as file (for example "picture1.bmp") ?

After I loaded the pdf document in a picture, I tried to save the picture with SavePicture, BitBlt, StretchBlt, PaintPicture, and so on, but I got "only" the empty picture: maybe I made some wrong ?

Any suggestion and/or VB6 example ?

Thanks a lot

Pino

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.