Platforms to show: All Mac Windows Linux Cross-Platform

CGPDFContextMBS class

Super class: CGContextMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class CoreGraphics MBS MacCG Plugin 12.0 ✅ Yes ❌ No ❌ No ✅ Yes All
A CoreGraphics context for PDF specific functions.
Example
// 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
c.EndPage

// flush and show in PDF viewer
c = nil
file.Launch
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.

Super class CGContextMBS

This class has no sub classes.

Some useful global functions for this class:

  • CGNewPDFDocumentMBS(consumer as CGDataConsumerMBS, MediaBox as CGRectMBS, title as string, author as string, creator as string) as CGPDFContextMBS
  • CGNewPDFDocumentMBS(file as folderitem, MediaBox as CGRectMBS, title as string, author as string, creator as string) as CGPDFContextMBS
  • CGNewPDFDocumentMBS(file as folderitem, MediaBox as CGRectMBS, title as string, author as string, creator as string, subject as string, keywords as string, OwnerPassword as string, UserPassword as string, AllowsPrinting as boolean, AllowsCopy as boolean) as CGPDFContextMBS
  • CGNewPDFDocumentMBS(file as folderitem, MediaBox as CGRectMBS, title as string, author as string, creator as string, subject as string, keywords as string, OwnerPassword as string, UserPassword as string, AllowsPrinting as boolean, AllowsCopy as boolean, KeyLength as Integer) as CGPDFContextMBS

Some methods using this class:

Blog Entries

Release notes


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


CGPDFArrayMBS   -   CGPDFDictionaryListMBS


The biggest plugin in space...