I want to have a several windows that have different drawings(art) on the screen. There will also be text boxes so I can input dimensions and info for the client to view and know how to build something based on the drawings I provide. Once filled out, the screen will show an installer/client a drawing of some artwork and dimensions of how to construct a wall and door framing. I want to be able to Save To PDF my screen after populating the screen with dimensions. There could be multiple screens, so I want to be able to capture to pdf the current screen, ideally saving the PDF AS to a clients folder on my local drive. This is sort of a screen capture but more of an elegant version of that.
There are also addons that allow you to create PDFs. MBS DynaPDF is a plugin that allows you to create PDFs using the DynaPDF library. gPDF is written in Xojo-code and creates PDFs as if you were drawing on a Graphics object.
if you’re on macos, you can use the built-in pdf printing services and this method :
[code]’ prints the window content
dim g as Graphics
g = OpenPrinterDialog( mPrinterSetup, mParent)
if g<>nil then
’ draws a picture of the complete window
dim p as new Picture( mParent.Width, mParent.Height, 32)
mParent.DrawInto p.Graphics, 0, 0
dim gheight as Integer = g.Width/p.Width*p.Height
[quote=350302:@Jean-Yves Pochez]if you’re on macos, you can use the built-in pdf printing services and this method :
[code]’ prints the window content
dim g as Graphics
g = OpenPrinterDialog( mPrinterSetup, mParent)
if g<>nil then
’ draws a picture of the complete window
dim p as new Picture( mParent.Width, mParent.Height, 32)
mParent.DrawInto p.Graphics, 0, 0
dim gheight as Integer = g.Width/p.Width*p.Height
end if
[/code][/quote]
which requires user intervention… that same code can be used with gPDF to write the PDF file directly to any folderitem without needing the OpenPrinterDialog… by the same token, you can take Christians suggestion to create the picture, and send THAT to gPDF