Platforms to show: All Mac Windows Linux Cross-Platform

/DynaPDF/DynaPDF Graphics/DynaPDF Graphics iOS

Required plugins for this example: MBS DynaPDF Plugin, MBS Main Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /DynaPDF/DynaPDF Graphics/DynaPDF Graphics iOS

This example is the version from Sun, 16th Jan 2021.

Project "DynaPDF Graphics iOS.xojo_binary_project"
Class App Inherits MobileApplication
End Class
Class Screen1 Inherits MobileScreen
Control ImageViewer1 Inherits MobileImageViewer
ControlInstance ImageViewer1 Inherits MobileImageViewer
Constraint Constraint 1
Constraint Constraint 2
Constraint Constraint 3
Constraint Constraint 4
End Control
EventHandler Sub Opening() Dim pdf As New MyDynapdfMBS Dim f1 As FolderItem = SpecialFolder.Documents.Child("DynaPDF Graphics.pdf") Dim f2 As FolderItem = SpecialFolder.Documents.Child("DynaPDF Graphics.png") Dim f3 As FolderItem = SpecialFolder.Documents.Child("DynaPDF Graphics Rendered.png") 'pdf.SetLicenseKey "Starter" // For this example you can use a Starter, Lite, Pro or Enterprise License If Not pdf.CreateNewPDF(f1) Then Return End If Call pdf.Append Dim g As Graphics = pdf.PageGraphics draw g, pdf // for debugging, show temp picture Dim p As Picture = pdf.PageGraphicsPicture p.Save(f2, Picture.Formats.PNG) Call pdf.EndPage If pdf.HasPro Then Call pdf.RenderPageToImage(1, f3, 150, 0, 0, pdf.krfDefault, pdf.kpxfRGB, pdf.kcfFlate, pdf.kifmPNG) End If Call pdf.CloseFile Dim pic As Picture = Picture.Open(f3) ImageViewer1.Image = pic 'ImageViewer1.Image = p End EventHandler
Sub draw(g as graphics, pdf as DynaPDFMBS = nil) // this is normal code as you would use with graphics class anyway // but we use GraphicsWrapper which can be DynaPDFGraphics, too. // so graphics can go to printer, window, picture or PDF! If pdf <> Nil Then // set pdf specific things End If g.DrawingColor=&c777777 g.DrawRectangle 0,0,g.Width-1,g.Height-1 g.DrawingColor=&cFF0000 g.DrawRectangle 100,100,200,200 g.DrawLine 0,0,100,100 g.DrawingColor=&c000000 g.DrawText "Hello",150,150 g.DrawLine 100,100,200,200 g.DrawingColor=&c00FF00 g.FillOval 100,0,100,100 g.DrawingColor=&c0000FF g.DrawOval 100,0,100,100 g.DrawingColor=&cFFFF00 g.FillRectangle 0,100,100,100 g.DrawingColor=&c000000 g.DrawRectangle 0,100,100,100 g.DrawingColor=&c00FF00 g.FillRoundRectangle 0,250,100,100,20,20 g.DrawingColor=&c000000 g.DrawRoundRectangle 0,250,100,100,20,20 g.DrawingColor = Color.RGB(100,200,255) Dim path As New DynapdfGraphicsPathMBS path.MoveToPoint 10, 10 path.AddLineToPoint 75, 30 path.AddLineToPoint 10, 125 g.FillPath path g.DrawingColor = &c000000 g.DrawPath path g.Font = New Font("Zapfino", 12) g.DrawText "Hello World", 200, 100 g.Font = Font.BoldSystemFont(14) g.DrawText "BoldSystemFont", 300, 100 g.Font = Font.ItalicSystemFont(14) g.DrawText "ItalicSystemFont", 300, 120 g.Underline = true g.DrawText "Underlined", 300, 140 g.Underline = False g.DrawText "Just a test with wrapping", 300, 160, 100 g.DrawText "Just a test with condensed", 300, 200, 100, True // test picture drawing dim logo as Picture = LogoMBS(200) g.DrawPicture logo, 200, 500 g.DrawPicture logo, 50, 500, 100, 200, 50, 50, 100, 100 // set a pixel 'g.Pixel(400,400)=&cFFFFFF End Sub
End Class
Class LaunchScreen Inherits iosView
End Class
Class MyDynaPDFMBS Inherits DynaPDFMBS
EventHandler Function Error(ErrorCode as integer, ErrorMessage as string, ErrorType as integer) As integer MessageBox ErrorMessage End EventHandler
End Class
End Project

See also:

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

The biggest plugin in space...