Preview PDF file in Canvas

Greetings,

Is there a way to preview a pdf document in a canvas ?

the idea is that once the document is created and the file is fetched to be able to show it in a canvas as preview.

Thanks.

If all you need to do with the PDF is display it, you can just open it like a picture and draw it in the canvas.

[code]thePDFPic = Picture.Open(f)

//in Canvas.Paint
If thePDFPic <> Nil Then
g.DrawPicture thePDFPic, 0, 0
End If[/code]

You can even use it as backdrop…

you will only get the first page of the pdf. if you want all pages you must use an htmlviewer.

Hello guys,

Thanks a lot for replies,

Yes I need first page as it will be always one page, I will test and come with feedback.

Thanks again .

the resolution of the pdf you get is also not very fine. you get a better picture with the same source converted to jpeg.

We do have a MBS DynaPDF Plugin.
The Pro edition can do rendering to display.

For Mac you can of course also use our plugins for PDFKit and CoreGraphics.

Use an HTMLViewer if you’re only display a PDF (and nothing else).

I made my own class, as a container control, with 2 pages, one canvas on one page and one htmlviewer on the other
switches automatically depending on the kind of picture you put into.
As I was there, I also added a plus and minus icon on the canvas to zoom in/out.
the htmlviewer already has them when it displays a pdf.

Yeap that’s my case, I just have to display the pdf and that’s it . It will be preview on the window once the doc is generated, then it is managed elsewhere so I don’t need to much hassle .

Thanks.