Class DxfPdfDefinition
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
A PDFDEFINITION of a DXF file, as AutoCAD's PdfDefinition: the page of a PDF file the PDFUNDERLAYs of a drawing
show, under its name in the dictionary of PDF underlays (GetPdfDictionary(DxfDatabase), ACAD_PDFUNDERLAYS).
public sealed class DxfPdfDefinition : DxfDBObject
- Inheritance
-
DxfPdfDefinition
- Inherited Members
Remarks
The library reads no PDF: the definition keeps the path as the file writes it (group 1) and the page's name (group 2),
which for a PDF is the page's number as text, 1 for the first. AutoCAD 2021 writes the page 1 of
D:\plans\sample.pdf as the groups 1 D:\plans\sample.pdf and 2 1, under the name sample - Page_1.
Made in code, a definition is added to a drawing's dictionary under a name, and a DxfPdfUnderlay is then
made of it: DxfDBDictionary underlays = DxfPdfDefinition.CreatePdfDictionary(db);
underlays.SetAt(DxfPdfDefinition.SuggestName(underlays, path, "1"), new DxfPdfDefinition(path, "1"));
Constructors
- DxfPdfDefinition(string, string)
Initializes a definition made in code of a page of a PDF file, as AutoCAD's
new PdfDefinition()given itsSourceFileNameandItemName. Added to a drawing by SetAt(string, DxfDBObject) of its dictionary of PDF underlays (CreatePdfDictionary(DxfDatabase)).
Properties
- ItemName
Gets the name of the page (group 2), as AutoCAD's
ItemName: the number of the page as text for a PDF,1for the first; empty where the record gives none.
- SourceFileName
Gets or sets the path of the PDF file (group 1), as AutoCAD's
SourceFileName: as the file writes it, a path of the machine it was drawn on or one relative to the drawing.
Methods
- CreatePdfDictionary(DxfDatabase)
Gets the dictionary of the PDF underlays of a drawing, made where it has none: ACAD_PDFUNDERLAYS of the named object dictionary, owned by it, of entries kept (281 of 1), as AutoCAD 2021 writes it.
- Erase()
Erases the definition, as AutoCAD 2021's
Eraseof aPdfDefinition: its entry of the dictionary of PDF underlays taken out, and with it every underlay of the drawing that shows it.
- GetEntityCount()
Gets how many underlays of the drawing show the definition: those whose handle (340) it is, an underlay in a block as one in model space; an erased underlay is not counted.
- GetPdfDictionary(DxfDatabase)
Gets the dictionary of the PDF underlays of a drawing: ACAD_PDFUNDERLAYS of the named object dictionary, each DxfPdfDefinition under its name; null where the drawing has none.
- SuggestName(DxfDBDictionary, string, string)
Gives a name for a definition of a page in a dictionary of PDF underlays, as the External References palette names one: the file's name without its folder or extension, then
- Page_and the page,sample - Page_1for page1ofC:\plans\sample.pdf; where the dictionary has that name, letters of either case the same, the name and_1, or_2and on, the first it has not.
- ToString()
Gives the definition as a line for debugging: its type, its handle, its path and its page.