Class DrawContext

java.lang.Object
com.itextpdf.layout.renderer.DrawContext

public class DrawContext extends Object
This class holds instances which required for drawing on pdf document.
  • Constructor Details

    • DrawContext

      public DrawContext (PdfDocument document, PdfCanvas canvas)
      Create drawing context by setting document and pdf canvas on which drawing will be performed.
      Parameters:
      document - pdf document
      canvas - canvas to draw on
    • DrawContext

      public DrawContext (PdfDocument document, PdfCanvas canvas, boolean enableTagging)
      Create drawing context by setting document and pdf canvas on which drawing will be performed.
      Parameters:
      document - pdf document
      canvas - canvas to draw on
      enableTagging - if true document drawing operations will be appropriately tagged
  • Method Details

    • getDocument

      public PdfDocument getDocument()
      Get pdf document.
      Returns:
      PdfDocument instance
    • getCanvas

      public PdfCanvas getCanvas()
      Get pdf canvas.
      Returns:
      PdfCanvas instance
    • isTaggingEnabled

      public boolean isTaggingEnabled()
      Get document tagging property.
      Returns:
      true if tagging is enabled, false otherwise
    • setTaggingEnabled

      public void setTaggingEnabled (boolean taggingEnabled)
      Set document tagging property.
      Parameters:
      taggingEnabled - true if to enable tagging, false to disable it