Table of Contents

Namespace OpenCAD2D.Wpf

Classes

CadPdfBookmark

One bookmark of a PDF's outline, the tree a reader shows beside the pages: a title, the page it goes to and the bookmarks under it. A PDF that has Sheets and Views with A-101 Ground floor plan and A-102 First floor plan under it, as AutoCAD writes a published sheet set, is one bookmark with no page (PageIndex -1) holding two that go to pages 0 and 1.

CadPdfWriter

The presenter's plotter, OpenCAD2D PDF: writes a plot as one page of a PDF through SkiaSharp's SKDocument.CreatePdf, in vectors, from the display list the canvas draws. Lines keep their lineweights, hatches and solids are filled, and the text of a TrueType font is written as text with its font embedded, cut to the glyphs used, so that a reader finds and copies it; the text of an SHX font is its strokes, as the canvas draws it, and is not found unless the settings carry PDFSHX (PdfShx), which writes the words again over the strokes in letters no eye sees. A plot stamp the settings carry (PlotStamp) is drawn in a corner of the sheet as text, and its line added to the stamp's log file. Several plots, as EXPORTPDF's All layouts, are written as one PDF of a page each (WritePages(string, CadDocument, IReadOnlyList<CadPlotJob>)), and those of several drawings, as PUBLISH writes them, by WritePages(string, IReadOnlyList<CadDocument>, IReadOnlyList<CadPlotJob>). Settings that carry PdfHyperlinks make the first hyperlink of each object plotted a link of the page over the object's box.

CadRasterWriter

Writes the image of PNGOUT, JPGOUT and BMPOUT (CadImageJob): the view drawn by SkiaCanvasRenderer at the view's size in pixels, on the canvas's background, with no cursor, grips or highlight, then a PNG of 8-bit red, green and blue, a JPEG at a quality of 90, or a bitmap of 24 bits a pixel. The same view gives the same bytes each time. The canvas writes what it shows, its grid included; this writes a view with no canvas, as a test or a host with no window does. A view of 1 920 by 1 080 pixels of a drawing of 100 000 entities is a PNG of 1.2 MB, written in 0.25 s.

CanvasOptions

How the canvas draws a space.

SkiaCanvasRenderer

Draws a display list onto a SkiaSharp canvas: lines, arcs flattened to the pixel, fills, text, and the viewports of a layout clipped to their frames or, for a clipped viewport, the outline of its boundary. It draws what the list holds and asks nothing of the drawing, so it can draw to a window's bitmap or to a PNG for a test. It draws only the items the view shows, found through the space's PickIndex, and spares the detail no eye could see: an item under half a pixel is one pixel of its colour, a text under 5 pixels high is drawn as a bar of its colour (SmallTextAsBars; off, a text under 3 pixels high is left out), and a hatch whose lines come closer than 2 pixels is filled with a tint of its colour. A selected or hovered entity is always drawn whole.