Xojo Conferences

MBS Xojo Plugin Tutorial Videos

DynaPDF Source

Note: The function DesktopFolder is deprecated in Xojo. You can replace it with SpecialFolder.desktop.

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /kunden/macsw.de/webseiten/monkeybreadsoftware-video/rbformat/rbcode.php on line 244
Class App
Inherits Application
// Constants
Const kFileQuitShortcut = Ctrl+Q
Const kFileQuit = E&xit
Const kEditClear = &Delete

// Event implementations
Sub Open()
dim pdf as new DynapdfMBS
dim f as FolderItem
dim source as FolderItem
dim d as new date
dim imagewidth, imageheight, bitsperpixel as integer
dim usezip as integer

'call pdf.SetPDFVersion(pdf.kpvPDF_1_3)

call pdf.CreateNewPDF f

call pdf.SetDocInfo pdf.kdiSubject, "The PDF subject"
call pdf.SetDocInfo pdf.kdiAuthor, "Christian"
call pdf.SetDocInfo pdf.kdiTitle, "My great PDF application"
call pdf.SetDocInfo pdf.kdiProducer, "Realbasic app"
call pdf.SetDocInfo pdf.kdiKeywords, "Realbasic"

source=DesktopFolder.Child("School Report.pdf")
call pdf.OpenImportFile source, 0, ""
call pdf.ImportPDFFile 1,1,1
call pdf.CloseImportFile

call pdf.Append
call pdf.SaveGraphicState

source=DesktopFolder.Child("Earth Horizon.jpg")

call pdf.ReadImageFormat(source, imagewidth, imageheight, bitsperpixel, usezip)

call pdf.SetSaveNewImageFormat(False)
call pdf.SetUseTransparency(true)
call pdf.InsertImageEx 100,200,imagewidth/4,imageheight/4,source,1

call pdf.SetFillColor pdf.kPDF_SKYBLUE
call pdf.Triangle 100,50,150,150,50,150,pdf.kfmFill

call pdf.RestoreGraphicState

call pdf.EndPage
call pdf.append

call pdf.SetFont "Times",pdf.kfsItalic,40,true,pdf.kcp1252
call pdf.WriteFText pdf.ktaCenter, "Just some text"

call pdf.SetFont "Zapfino", pdf.kfsBold, 20, true, pdf.kcp1252
call pdf.WriteText 50,400,"Date: "+d.LongDate

call pdf.EndPage
call pdf.CloseFile



End Sub
End Class

Class Window1
Inherits Window
End Class

All movies

MBS Xojo Plugins