Platforms to show: All Mac Windows Linux Cross-Platform

/DynaPDF/Create PDF with Colors
Function:
Required plugins for this example: MBS DynaPDF Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /DynaPDF/Create PDF with Colors
This example is the version from Sun, 15th Oct 2022.
Project "Create PDF with Colors.xojo_binary_project"
FileTypes
Filetype text
End FileTypes
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu5 = ""
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
MenuItem UntitledMenu4 = ""
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = ""
End MenuBar
Class App Inherits Application
EventHandler Sub Open() Dim pdf As New DynapdfMBS dim f as FolderItem = SpecialFolder.Desktop.Child("Create PDF with Colors.pdf") pdf.SetLicenseKey "Pro" // For this example you can use a Starter, Lite, Pro or Enterprise License call pdf.CreateNewPDF f // We want to use top-down coordinates call pdf.SetPageCoords pdf.kpcTopDown Call pdf.Append // CMYK Call pdf.SetColorSpace(pdf.kcsDeviceRGB) Call pdf.SetFillColor(0) // black Call pdf.WriteText 10, 40-10, "CMYK" Call pdf.SetColorSpace(pdf.kcsDeviceCMYK) // cyan Call pdf.SetFillColor(Array(1.0, 0.0, 0.0, 0.0)) Call pdf.DrawCircle( 60, 40, 10, pdf.kfmFill) // magenta Call pdf.SetFillColor(Array(0.0, 1.0, 0.0, 0.0)) Call pdf.DrawCircle(100, 40, 10, pdf.kfmFill) // yellow Call pdf.SetFillColor(Array(0.0, 0.0, 1.0, 0.0)) Call pdf.DrawCircle(140, 40, 10, pdf.kfmFill) // black Call pdf.SetFillColor(Array(0.0, 0.0, 0.0, 1.0)) Call pdf.DrawCircle(180, 40, 10, pdf.kfmFill) // dark blue with cyan + magenta Call pdf.SetFillColor(Array(1.0, 1.0, 0.0, 0.0)) Call pdf.DrawCircle(220, 40, 10, pdf.kfmFill) // dark red with magenta + yellow Call pdf.SetFillColor(Array(0.0, 1.0, 1.0, 0.0)) Call pdf.DrawCircle(260, 40, 10, pdf.kfmFill) // dark green with cyan + yellow Call pdf.SetFillColor(Array(1.0, 0.0, 1.0, 0.0)) Call pdf.DrawCircle(300, 40, 10, pdf.kfmFill) // RGB Call pdf.SetColorSpace(pdf.kcsDeviceRGB) Call pdf.SetFillColor(0) // black Call pdf.WriteText 10, 80-10, "RGB" // red Call pdf.SetFillColor(Array(1.0, 0.0, 0.0)) Call pdf.DrawCircle( 60, 80, 10, pdf.kfmFill) // green Call pdf.SetFillColor(Array(0.0, 1.0, 0.0)) Call pdf.DrawCircle(100, 80, 10, pdf.kfmFill) // blue Call pdf.SetFillColor(Array(0.0, 0.0, 1.0)) Call pdf.DrawCircle(140, 80, 10, pdf.kfmFill) // yellow Call pdf.SetFillColor(Array(1.0, 1.0, 0.0)) Call pdf.DrawCircle(180, 80, 10, pdf.kfmFill) // cyan Call pdf.SetFillColor(Array(0.0, 1.0, 1.0)) Call pdf.DrawCircle(220, 80, 10, pdf.kfmFill) // magenta Call pdf.SetFillColor(Array(1.0, 0.0, 1.0)) Call pdf.DrawCircle(260, 80, 10, pdf.kfmFill) // black Call pdf.SetFillColor(Array(0.0, 0.0, 0.0)) Call pdf.DrawCircle(300, 80, 10, pdf.kfmFill) // Gray Call pdf.SetColorSpace(pdf.kcsDeviceGray) Call pdf.SetFillColor(0) // black Call pdf.WriteText 10, 120-10, "Gray" // black Call pdf.SetFillColor(Array(0.0)) Call pdf.DrawCircle( 60, 120, 10, pdf.kfmFill) // dark gray Call pdf.SetFillColor(Array(0.1)) Call pdf.DrawCircle(100, 120, 10, pdf.kfmFill) // dark gray Call pdf.SetFillColor(Array(0.3)) Call pdf.DrawCircle(140, 120, 10, pdf.kfmFill) // half gray Call pdf.SetFillColor(Array(0.5)) Call pdf.DrawCircle(180, 120, 10, pdf.kfmFill) // light gray Call pdf.SetFillColor(Array(0.7)) Call pdf.DrawCircle(220, 120, 10, pdf.kfmFill) // light gray Call pdf.SetFillColor(Array(0.9)) Call pdf.DrawCircle(260, 120, 10, pdf.kfmFill) // white Call pdf.SetFillColor(Array(1.0)) Call pdf.DrawCircle(300, 120, 10, pdf.kfmFill) Call pdf.EndPage call pdf.CloseFile f.Launch quit End EventHandler
End Class
End Project

See also:

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

Feedback: Report problem or ask question.

The biggest plugin in space...


Start Chat