PdfDashStyle
12 Sep 20251 minute to read
Public enum to define the dash style.
// 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 pen
let pen: PdfPen = new PdfPen([0, 0, 0], 1);
// Set the dash style
pen._dashStyle = PdfDashStyle.dashDot;
// Draw a rectangle using pen
graphics.drawRectangle(150, 50, 50, 50, pen);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();-
custom- Specifies the type ofcustom. -
dash- Specifies the type ofdash. -
dashDot- Specifies the type ofdashDot. -
dashDotDot- Specifies the type ofdashDotDot. -
dot- Specifies the type ofdot. -
solid- Specifies the type ofsolid.