Drawings SDK Developer Guide > Working with .dwg Files > Working with Other File Formats > Exporting to Other Formats > Exporting to a PDF File > Export to PDF File Parameters and Flags > Export Hatches to PDF
Export Hatches to PDF

There are three kinds of hatches (as shown in the picture below):

  • Solid hatch — A hatch with a one-color solid fill.
  • Gradient hatch — A hatch filled with one or two gradient colors.
  • Pattern hatch — A hatch filled with a specified pattern.

Export to PDF operations can differ depending on what kind of hatch is exported.

There are three ways of exporting hatches to PDF (using the ExportHatchesType enumerator):

  • PDF path (recommended, corresponds to the kPdfPaths enumerator value) — Results in a smaller PDF file size than other methods and avoids distortion of graphical elements. This algorithm exports only the outer loop of the hatch and then fills this loop with the appropriate color.
  • Vectorizer (corresponds to the kDrawing enumerator value) — Divides the hatch into many triangles; each can contain its own color. This leads to a larger output file size.
  • Bitmap export (corresponds to the kBitmap enumerator value) — Realizes hatches as a bitmap picture. The result of exporting a hatch as a bitmap looks smoother than a vectorizer and often has a smaller output file size. The output file size strongly depends on the DPI (Dots Per Inch) resolution specified for the export process. Increasing the DPI provides better quality but a larger output file.
    To retrieve the current resolution used for exporting hatches as a bitmap, call the hatchDPI() method of the PDFExportParams class.
    To change the resolution, use the setHatchDPI() method of the PDFExportParams class.

The PDF path export algorithm can be applied only to solid hatches, not gradient or pattern hatches. In those cases, bitmap export is automatically applied.

To get the current type of solid hatch for exporting, use the solidHatchesExportType() method of the PDFExportParams class. To set a new type of solid hatch for exporting, use the setSolidHatchesExportType() method of the PDFExportParams class.

Bitmap and vectorizer export can be applied to hatches of any type.

To get the current type of gradient hatch for exporting, use the gradientHatchesExportType() method of the PDFExportParams class. To set a new type of gradient hatch for exporting, use the setGradientHatchesExportType() method of the PDFExportParams class.

To get the current type of pattern hatch for exporting, use the otherHatchesExportType() method of the PDFExportParams class. To set a new type of pattern hatch for exporting, use the setOtherHatchesExportType() method of the PDFExportParams class.

The quality of exported hatches for vectorizer and PDF path export types depends on the resolution (DPI) used for vectorizing.

To get the current vectorizer resolution, use the getGeomDPI() method of the PDFExportParams class. To set a new vectorizer resolution, use the setOtherGeomDPI() method of the PDFExportParams class.

See Also

Export to PDF Parameters and Flags

Copyright © 2002 – 2021. Open Design Alliance. All rights reserved.