/ PDF / PdfFillMode
Search results

PdfFillMode API in JavaScript PDF API control

Public enum to define fill mode of the PDF page.

// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Access first page
let page: PdfPage = document.getPage(0);
// Gets the graphics of the PDF page
let graphics: PdfGraphics = page.graphics;
// Create a new font
let font: PdfStandardFont = new PdfStandardFont(PdfFontFamily.symbol, 10);
// Set the fill mode
graphics.setClip([0, 0, 100, 100], PdfFillMode.winding);
// Draw the text
graphics.drawString('Hello World', font, null, new PointF(10, 10));
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();
  • alternate - Specifies the type of alternate.
  • winding - Specifies the type of winding.