Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

CGPDFContextMBS class

Super class: CGContextMBS

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class CoreGraphics MBS MacCG Plugin 12.0 Yes No No Yes, macOS only No
Function: A CoreGraphics context for PDF specific functions.
// create pdf
dim file as FolderItem = SpecialFolder.Desktop.Child("test.pdf")
dim r as new CGRectMBS(0,0,500,500)
dim c as CGContextMBS = file.NewCGPDFDocumentMBS(r, "My Title", "My Author", "My Creator")

if c<>Nil then

// create page
c.BeginPage r

// draw something
c.SetRGBFillColor(1.0, 0.0, 0.0, 1.0)
c.FillRect CGMakeRectMBS(100,100,100,100)

// close page

// flush and show in PDF viewer
c = nil
end if
This class defines functions to create and get information about a Quartz PDF context. A CGPDFContext object is a type of CGContext that is used for drawing PDF content. The functions in this reference operate only on Quartz PDF graphics contexts created using the functions CGPDFContextCreate or CGPDFContextCreateWithURL.

When you draw to the PDF context using CGContext functions the drawing operations are recorded in PDF format. The PDF commands that represent the drawing are written to the destination specified when you create the PDF graphics context.
Subclass of the CGContextMBS class.

Feedback, Comments & Corrections

Super class CGContextMBS

This class has no sub classes.

Some useful global functions for this class:

Some methods using this class:

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

CGPDFArrayMBS   -   CGPDFDictionaryListMBS

MBS Xojo PDF Plugins