Platforms to show: All Mac Windows Linux Cross-Platform

/DynaPDF/PlaceTemplate test


Required plugins for this example: MBS DynaPDF Plugin

Last modified Mon, 15th Feb 2026.

You find this example project in your MBS Xojo Plugin download as a Xojo project file within the examples folder: /DynaPDF/PlaceTemplate test

Download this example: PlaceTemplate test.zip

Project "PlaceTemplate test.xojo_binary_project"
Class App Inherits DesktopApplication
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Opening() Var inputFile As FolderItem = GetFolderItem("license.pdf") Var outputFile As FolderItem = SpecialFolder.Desktop.Child("output.pdf") var pdf As New DynapdfMBS pdf.SetLicenseKey "Lite" // For this example you can use a Lite, Pro or Enterprise License Call pdf.CreateNewPDF outputFile Call pdf.OpenImportFile(InputFile,pdf.kptOpen,"") Call pdf.SetImportFlags(pdf.kifImportAll) call pdf.SetCompressionLevel(0) // load a page as template, so we can place it later Var Template As Integer = pdf.ImportPage(1) var TemplateWidth as Double = pdf.GetTemplWidth(template) Var TemplateHeight As Double = pdf.GetTemplHeight(template) // now place the template picture with mirror if true then Call pdf.Append call pdf.SetPageWidth(TemplateWidth * 2) Call pdf.SetPageHeight(TemplateHeight * 2) // place normally Call pdf.PlaceTemplate(Template, TemplateWidth, TemplateHeight, 0, 0) // place mirrored Call pdf.PlaceTemplate(Template, 0, 0, -1, -1) // place mirrored vertically Call pdf.PlaceTemplate(Template, TemplateWidth, 0, 0, -1) // place mirrored horizontally Call pdf.PlaceTemplate(Template, 0, TemplateHeight, -1, 0) Call pdf.EndPage end if if true then Call pdf.Append Call pdf.SetPageWidth(TemplateWidth * 2) Call pdf.SetPageHeight(TemplateHeight * 2) // place normally Call pdf.PlaceTemplateEx(Template, TemplateWidth, TemplateHeight, 0, 0) // place mirrored Call pdf.PlaceTemplateEx(Template, 0, 0, -1, -1) // place mirrored vertically Call pdf.PlaceTemplateEx(Template, TemplateWidth, 0, 0, -1) // place mirrored horizontally Call pdf.PlaceTemplateEx(Template, 0, TemplateHeight, -1, 0) Call pdf.EndPage end if Call pdf.CloseImportFile Call pdf.CloseFile pdf = Nil outputFile.Launch Quit End EventHandler
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
MenuItem WindowMenu = "Window"
MenuItem HelpMenu = "&Help"
End MenuBar
Sign
End Sign
End Project

Download this example: PlaceTemplate test.zip

The items on this page are in the following plugins: MBS DynaPDF Plugin.


The biggest plugin in space...