Namespace PDFjet.NET
Classes
- A3
Used to specify PDF page with size A3. For more information about the page size classes - A3, A4, A5, B5, JISB5, Executive, Letter, Legal and Tabloid - see the Page class.
- A4
Used to specify PDF page with size A4. For more information about the page size classes - A3, A4, A5, B5, JISB5, Executive, Letter, Legal and Tabloid - see the Page class.
- A5
Used to specify PDF page with size A5. For more information about the page size classes - A3, A4, A5, B5, JISB5, Executive, Letter, Legal and Tabloid - see the Page class.
- Arc
Used to create arc objects.
- B5
Used to specify PDF page with size B5, the ISO 216 B5 of 176 by 250 mm. For more information about the page size classes - A3, A4, A5, B5, JISB5, Executive, Letter, Legal and Tabloid - see the Page class.
- BarChart
Bar chart renderer for PDF pages: one slot per category, the bars of the series grouped inside each slot. A value of a line series outside a range that is set cuts its line at the edge of the plot, and the chart says how many are: "2 values outside the range", small, under the plot at its right end, and in its description, in that alone when the plot would not be left room to draw. See Example_27, of horizontal and vertical bars.
- Barcode
Used to create one dimensional barcodes - EAN-13, UPC-A, Code 39 and Code 128. Leave a quiet zone, blank, on both sides of the bars, as a scanner needs it: 10 modules for Code 128 and Code 39, 9 for UPC-A, and 11 on the left and 7 on the right for EAN-13. ITF-14 draws its own.
The text of an ITF-14 barcode is the 13 digits of a GTIN without its check digit, which is added, as for UPC-A and EAN-13.
Please see Example_36.
- BaseAnnotation
The base class of the circle, square, polygon and text annotations.
- Bidi
Provides BIDI processing for Arabic, Persian, Urdu and Hebrew.
Please see Example_04.
- BigTable
A table of plain rows of any length, a statement, a list or an export: every row has one style, and a field too wide for its column is cut short, or, with SetWrapText, wraps onto more lines, the row as tall as its tallest field. For drawables in cells, spanned cells or page totals, use Table. The rows are read row by row from a delimited text file or from an IEnumerable. Each page is written as soon as it is full, so the memory stays flat however many rows there are. A PDF/UA document holds no more than that either: the table is tagged as a table, and the structure elements of a page are written with it. What is left is one cross-reference entry for each of them, which every object of a PDF has.
- Bookmark
Please see Example_41
- Border
Used to control the visibility of cell borders. See the Cell class for more information.
- CascadiaMono
The Cascadia Mono fonts, Microsoft's monospace font, with all of Latin, Greek and Cyrillic in every face, the italic ones too. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. PDFjet carries these fonts in itself: the path is read from the library when there is no such file.
- Cell
Used to create table cell objects. See the Table class for more information.
- CheckBox
Creates a CheckBox, which can be set checked or unchecked. By default the check box is unchecked. Portions provided by Shirley C. Christenson Shirley Christenson Consulting
- CircleAnnotation
A circle annotation.
- Color
Used to specify the pen and brush colors, as 0xRRGGBB values. The names are the CSS color keywords, in lower case as in CSS, and oldgloryred and oldgloryblue, the colors of the flag of the United States.
- CompositeTextLine
This class was designed and implemented by Jon T. Swanson, Ph.D.
Used to create composite text line objects.
- Container
A group of drawable elements that are moved, rotated and scaled together: shapes, text, images, annotations, stamps and nested containers.
What a container is good at: it takes anything that implements IDrawable, so a group can hold an Image, a Table, a chart, a barcode, a link or another annotation, and each element keeps everything it can do. Each element also tags itself in a PDF/UA document, so a TextLine in a container is a paragraph of its own and an Image is a figure with its alternate description. Laying a group out once and placing it, rotated or scaled, is what it is for; elements that have no rotation of their own get one this way.
What it costs: the elements are drawn into the page on every DrawOn, so a container on 100 pages writes its drawing 100 times over.
Use a Stamp instead for content that repeats on many pages -- a header, a footer, a logo, a watermark -- which is written once as a form XObject and placed with a few bytes. Of a 200 by 50 point box with two lines of text, a container writes 367 bytes into every page and a stamp 83, so the stamp is the smaller of the two from the fourth page on: over 100 pages it saves 12,855 bytes of a 104,530 byte file, and over 500 pages 66,052 of 275,553. On one page the stamp is the larger, since its XObject costs about 300 bytes of its own, and it draws only paths and text in an embedded font.
Please see Example_42 and Example_31.
- Content
Reads the contents of files and streams.
- CoreFont
The metrics of the 14 standard PDF fonts.
- DataMatrix
Used to create 2D Data Matrix barcodes: ECC 200 symbols as specified in ISO/IEC 16022. The text is encoded as UTF-8 in the smallest symbol that holds it. Leave a quiet zone, blank, of a module all around the symbol, as a scanner needs it. Please see Example_37.
- Destination
A destination on a page, made by Page.AddDestination.
- Dimension
Encapsulates the width and height of a component.
- DonutChart
A donut or pie chart: each slice is its value's share of the sum of the values, with a label next to it and its percentage inside it. A chart with an inner radius of 0 is a pie chart. In the look of the other charts: a title and a subtitle at the top left, thin white lines between the slices, gray leader lines, the labels in ink, and each percentage white or ink by its slice's color. See Example_28.
- Ellipse
An ellipse: an arc that sweeps 360 degrees.
- EmbeddedFile
Used to embed file objects. The file objects must added to the PDF before drawing on the first page.
- Encryption
Encrypts a PDF with 256-bit AES as defined in ISO 32000-2 (PDF 2.0). Pass the encryption object to PDF.SetEncryption. Please see Example_47.
- Executive
Used to specify PDF page with size Executive. For more information about the page size classes - A3, A4, A5, B5, JISB5, Executive, Letter, Legal and Tabloid - see the Page class.
- Field
Please see Example_44
- FileAttachment
Used to attach file objects.
- Font
Used to create font objects. The font objects must be added to the PDF before they can be used to draw text.
- Form
Please see Example_44
- GS1
Reads GS1 data as people write it, each Application Identifier in parentheses and its data after it, for the barcodes that carry it: GS1 DataMatrix and GS1-128, and makes its GS1 Digital Link.
- GraphicsState
Holds the alpha values of stroking and non-stroking operations.
- HBShape
A shaper for TextBlock and TextLine that runs hb-shape, the program of HarfBuzz, the text engine of Chrome and Android, with nothing linked into the program; used only when given with SetShaper. The NuGet package PDFjet.HarfBuzz gives the same glyphs with nothing to install. Lines break at spaces and, in Thai, Lao, Khmer and Burmese, between words, by ICU's dictionaries of the world fonts. hb-shape is installed on the server, HarfBuzz 15 or newer: on Ubuntu and Debian apt install libharfbuzz-bin; on Fedora and RHEL dnf install harfbuzz-utils; on macOS and Linux brew install harfbuzz; on Windows harfbuzz-win64-<version>.zip of github.com/harfbuzz/harfbuzz/releases. It talks with hb-shape through files, not pipes, the same on every system: the text of each font in a temporary file, the glyphs back in another.
new TextBlock(hindi, text).SetFallbackFont(latin).SetShaper(new HBShape())
- HarfBuzzGlyph
A glyph a HarfBuzz shaped, in font units.
- HarfBuzzShaper
A shaper for TextBlock and TextLine that shapes with a HarfBuzz as HBShape does with hb-shape: each character in the first font that has it, a mark in the font of the character it is on, each run of one font shaped in that font, and the lines broken at spaces and, in Thai, Lao, Khmer and Burmese, between words, by ICU's dictionaries of the world fonts. Two HarfBuzzes that shape alike give the same lines.
- IBMPlexMath
The IBM Plex Math fonts, which PDFjet does not carry from 9.1.7: each constant is the path of a font file of the packages of PDFjet before 9.1.7, which the Font constructor that takes a font path reads when the file is there.
- IBMPlexMono
The IBM Plex Mono fonts, which PDFjet does not carry from 9.1.7: each constant is the path of a font file of the packages of PDFjet before 9.1.7, which the Font constructor that takes a font path reads when the file is there.
- IBMPlexSans
The IBM Plex Sans fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. PDFjet carries these fonts in itself: the path is read from the library when there is no such file.
- IBMPlexSansArabic
The IBM Plex Sans Arabic fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew and Thai, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add.
- IBMPlexSansHebrew
The IBM Plex Sans Hebrew fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew and Thai, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add.
- IBMPlexSansJP
The IBM Plex Sans JP fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew and Thai, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add.
- IBMPlexSansKR
The IBM Plex Sans KR fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew and Thai, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add.
- IBMPlexSansSC
The IBM Plex Sans SC fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew and Thai, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add.
- IBMPlexSansTC
The IBM Plex Sans TC fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew and Thai, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add.
- IBMPlexSansThai
The IBM Plex Sans Thai fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew and Thai, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add.
- IBMPlexSerif
The IBM Plex Serif fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. PDFjet carries these fonts in itself: the path is read from the library when there is no such file.
- Image
Used to create image objects and draw them on a page. The image type can be one of the following: ImageType.JPG, ImageType.PNG or ImageType.BMP
Please see Example_32 and Example_14.
- ImageSize
The size an image is drawn at, and its pixels, read from the header of its file alone, without its image data in memory: the size of a page laid out before its images are drawn, and an image refused early, for its size or for a header that Image refuses, before a byte of its image data is decoded.
The size is the one Image gives the image: its pixels, or the physical size the file asks for, the pHYs chunk of a PNG, the JFIF density of a JPEG or the pixels per metre of a BMP; a JPEG turned a quarter of the way by its Exif orientation is its height by its width. What only the image data shows, a JPEG cut short or the rows of a PNG, is Image's to refuse.
- JISB5
Used to specify PDF page with size JIS B5, the Japanese B5 of 182 by 257 mm. For more information about the page size classes - A3, A4, A5, JISB5, Executive, Letter, Legal and Tabloid - see the Page class.
- JetBrainsMono
The JetBrains Mono fonts, which PDFjet does not carry from 9.1.7: each constant is the path of a font file of the packages of PDFjet before 9.1.7, which the Font constructor that takes a font path reads when the file is there.
- Legal
Used to specify PDF page with size Legal. For more information about the page size classes - A3, A4, A5, B5, JISB5, Executive, Letter, Legal and Tabloid - see the Page class.
- Letter
Used to specify PDF page with size Letter. For more information about the page size classes - A3, A4, A5, B5, JISB5, Executive, Letter, Legal and Tabloid - see the Page class.
- Line
Used to create line objects.
Please see Example_08 and Example_35.
- Mark
Used to specify the check mark in CheckBox.
- Markdown
Draws a Markdown text on as many pages as it needs: headings of # and of underlines, paragraphs with the inline markup of Markup, bullet and numbered lists that nest, block quotes, fenced and indented code, thematic breaks, the tables and the task lists of GitHub's Markdown, - [ ] and
- [x], drawn as boxes, and images alone in their paragraph. In a PDF/UA document the headings are H1 to H6, with no level skipped, the lists are lists, the boxes of the tasks their labels, read as ☐ and ☑, the quotes BlockQuotes, the code Code, the tables tables and the images figures, with their text as the alternate description. In any document the headings are its bookmarks, the outline a reader shows, unless it has bookmarks of its own.
A line that ends in two spaces or a backslash, and a <br>, break the line, in a table cell too, and the entities of Markup, as & and —, are the characters they name.
It is not all of Markdown: other HTML is drawn as the text it is, any other line break is a space, links in a table cell are its text, and an image is drawn only when it is alone in its paragraph, from the directory that SetImageDirectory names; with none, its text is drawn instead, so that a text from anyone reads no file. Please see Example_19.
To build the pages from paragraphs and images of your own, use TextFlow.
- Markup
Makes paragraphs of text with the inline markup of Markdown: bold, italic, bold italic,
codeand links, in the fonts given for each, and as GitHub's Markdown has them, bold and italic,strikethroughof two ~, one being text here, as in ~5, and links that are their address, <https://pdfjet.com> or https://pdfjet.com alone. An _ emphasizes only at the edge of a word, so that snake_case is text; an address alone ends before the punctuation at its end, as the period of a sentence, and before a ) that closes no ( of its own. A backslash before a punctuation character, as in *, makes it plain text, and so is a mark that has no match, such as the * of 2 * 3. Emphasis can be inside a link, and neither inside code. A word keeps its punctuation next to it in another style, as in bold, with no space between them: the paragraph joins its text lines with Paragraph.AddJoined.A line that ends in two spaces or a backslash, and a <br>, are hard line breaks, which TextFrame draws as the end of a row, and the spaces before the line break are not in the text; two spaces and a line break at the end of the text are not, and are dropped, and a backslash at the end of the text is a backslash, as in CommonMark. Any other line break is a space, none at the start of a row. \n, \r\n and \r are each a line break. The spaces and tabs around a line break, hard or not, are not in the text, as in CommonMark, and a space written   is. The entities &, <, >, ", ', , ©, ®, ™, —, –, …, the quotes and a few more, and the numbers — and —, are the characters they name.
Headings, lists, block quotes and the rest of Markdown's blocks are not read: Paragraphs splits a text into paragraphs at its empty lines. The markup is read in time linear in the length of the text, so it can come from anyone. Please see Example_18.
- NotoSans
The Noto Sans fonts, which PDFjet does not carry from 9.1.7: each constant is the path of a font file of the packages of PDFjet before 9.1.7, which the Font constructor that takes a font path reads when the file is there.
- NotoSansBengali
The Noto Sans Bengali fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew, Thai and others, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add. PDFjet does not shape Bengali: these fonts are for TextBlock and TextLine, which draw the text as a shaping engine shapes it with the same font file, for Bengali and Assamese. Regular and Bold, from Noto's release, unmodified.
- NotoSansDevanagari
The Noto Sans Devanagari fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew, Thai and others, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add. PDFjet does not shape Devanagari: these fonts are for TextBlock and TextLine, which draw the text as a shaping engine shapes it with the same font file, for Hindi, Marathi, Nepali and Sanskrit. Regular and Bold, from Noto's release, unmodified.
- NotoSansGujarati
The Noto Sans Gujarati fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew, Thai and others, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add. PDFjet does not shape Gujarati: these fonts are for TextBlock and TextLine, which draw the text as a shaping engine shapes it with the same font file, for Gujarati. Regular and Bold, from Noto's release, unmodified.
- NotoSansGurmukhi
The Noto Sans Gurmukhi fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew, Thai and others, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add. PDFjet does not shape Gurmukhi: these fonts are for TextBlock and TextLine, which draw the text as a shaping engine shapes it with the same font file, for Punjabi. Regular and Bold, from Noto's release, unmodified.
- NotoSansKannada
The Noto Sans Kannada fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew, Thai and others, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add. PDFjet does not shape Kannada: these fonts are for TextBlock and TextLine, which draw the text as a shaping engine shapes it with the same font file, for Kannada. Regular and Bold, from Noto's release, unmodified.
- NotoSansKhmer
The Noto Sans Khmer fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew, Thai and others, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add. PDFjet does not shape Khmer: these fonts are for TextBlock and TextLine, which draw the text as a shaping engine shapes it with the same font file, for Khmer. Regular and Bold, from Noto's release, unmodified.
- NotoSansLao
The Noto Sans Lao fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew, Thai and others, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add. PDFjet does not shape Lao: these fonts are for TextBlock and TextLine, which draw the text as a shaping engine shapes it with the same font file, for Lao. Regular and Bold, from Noto's release, unmodified.
- NotoSansMalayalam
The Noto Sans Malayalam fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew, Thai and others, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add. PDFjet does not shape Malayalam: these fonts are for TextBlock and TextLine, which draw the text as a shaping engine shapes it with the same font file, for Malayalam. Regular and Bold, from Noto's release, unmodified.
- NotoSansMyanmar
The Noto Sans Myanmar fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew, Thai and others, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add. PDFjet does not shape Myanmar: these fonts are for TextBlock and TextLine, which draw the text as a shaping engine shapes it with the same font file, for Burmese. Regular and Bold, from Noto's release, unmodified.
- NotoSansOriya
The Noto Sans Oriya fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew, Thai and others, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add. PDFjet does not shape Odia: these fonts are for TextBlock and TextLine, which draw the text as a shaping engine shapes it with the same font file, for Odia. Regular and Bold, from Noto's release, unmodified.
- NotoSansSinhala
The Noto Sans Sinhala fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew, Thai and others, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add. PDFjet does not shape Sinhala: these fonts are for TextBlock and TextLine, which draw the text as a shaping engine shapes it with the same font file, for Sinhala. Regular and Bold, from Noto's release, unmodified.
- NotoSansTamil
The Noto Sans Tamil fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew, Thai and others, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add. PDFjet does not shape Tamil: these fonts are for TextBlock and TextLine, which draw the text as a shaping engine shapes it with the same font file, for Tamil. Regular and Bold, from Noto's release, unmodified.
- NotoSansTelugu
The Noto Sans Telugu fonts. Each constant is the path of a font file, embedded as a subset of the glyphs a document draws; pass it to the Font constructor that takes a font path. These fonts are not in the NuGet package PDFjet: they are in the package PDFjet.Fonts.World, with PDFjet's fonts for Chinese, Japanese, Korean, Arabic, Hebrew, Thai and others, which a program that draws in them adds next to it, with
dotnet add package PDFjet.Fonts.World, or in the project file<PackageReference Include="PDFjet.Fonts.World" Version="9.1.7" />, the same version as PDFjet's. The path is read from the file of that path, else from the folder resources/fonts/world, as in the release packages on GitHub, else from that package, and a font found in none says what to add. PDFjet does not shape Telugu: these fonts are for TextBlock and TextLine, which draw the text as a shaping engine shapes it with the same font file, for Telugu. Regular and Bold, from Noto's release, unmodified.
- OptionalContentGroup
Container for drawable objects that can be drawn on a page as part of Optional Content Group. Please see the PDF specification and Example_47 for more details.
Used to create PDF objects that represent PDF documents.
- PDF417
Used to create PDF417 2D barcodes.
The bars are drawn from the location set with SetLocation. ISO/IEC 15438 asks for a quiet zone of at least two modules (twice the module width) on all four sides of the symbol, so leave that much space around it; scanners reject symbols with less.
Please see Example_38.
- PDFobj
An object of a PDF that was read with PDF.Read, which holds the tokens of its dictionary and its stream. See Example_34, Example_48 and Example_50.
- Page
Used to create PDF page objects.
Please note:
The coordinate (0.0f, 0.0f) is the top left corner of the page. The size of the pages are represented in points. 1 point is 1/72 inches.
- PageSize
The width and height of a page in points; 1 point is 1/72 inch. A page size cannot be changed once it is created, so the PORTRAIT and LANDSCAPE constants of A3, A4, A5, B5, JISB5, Executive, Legal, Letter and Tabloid are the same for every page made with them. Use the constructor for any other page size.
- Paragraph
Used to create paragraph objects. See the TextColumn class for more information.
- Passwords
The user and owner passwords of an encrypted PDF. A password is used as typed, in UTF-8, and at most 127 bytes of it are used. Chrome does not cut a longer password to its first 127 bytes, as other viewers do, and opens the PDF only when just those are typed, so a password of 127 bytes or fewer is the one to give. Please see Example_47.
- Path
Used to create path objects. The path objects may consist of lines, splines or both.
Please see Example_34 and Example_40.
- Permissions
The permissions of an encrypted PDF: the UserAccess flags a reader grants the user, written to the /P entry of the encryption dictionary.
- Point
A point with a marker: a shape drawn around its (x, y) coordinates, which are the center of the marker. A point is drawn on a page on its own, as the marker of a table cell, and a list of points is a path for Page.DrawPath.
Please see Example_05.
- PolygonAnnotation
A polygon annotation.
- QRCode
Used to create 2D QR Code barcodes. Leave a quiet zone, blank, of 4 modules all around the code, as a scanner needs it. Please see Example_37.
- RadioButton
Creates a RadioButton, which can be set selected or unselected.
- Rect
A rectangle that can be drawn on a page.
- SVGImage
Used to embed SVG images in the PDF document.
It draws the path, rect, circle, ellipse, line, polyline and polygon elements, in groups or not, with their transforms, and the fill, stroke, stroke-width, stroke-dasharray, stroke-dashoffset, fill-rule, stroke-linecap, stroke-linejoin, stroke-miterlimit, opacity, fill-opacity, stroke-opacity, visibility, paint-order, clip-path and markers they have or inherit, as attributes, in a style attribute or in rules for their classes in a style element that comes before them. It draws the elements a use element names, a symbol at the size of the use, a nested svg at its x, y and viewBox, the first child of a switch that it can draw and whose systemLanguage has the language of the PDF, which is known when the image is drawn, and, of any element, one whose systemLanguage has that language or that has none, and text and tspan elements with their x, y, dx, dy, font-size, font-weight, text-anchor and dominant-baseline, in the font set with SetFont and SetBoldFont, or else in the fonts PDFjet carries, embedded: IBM Plex Sans for sans-serif, Helvetica, Arial and the like, IBM Plex Serif for serif, Times and the like, Cascadia Mono for monospace, Courier and the like, regular, semibold or bold, upright or italic, as the font-family, font-weight and font-style of the text ask. A gradient is drawn in the mean color of its stops. The width, height, viewBox and preserveAspectRatio of the svg element give the size of the image, and what is drawn outside it is cut off, as a browser does, and so is what a symbol, a marker or a nested svg draws outside its viewport, unless its overflow is visible or auto. A clipPath clips with its shapes or, when it has none, with its text elements, in those fonts, by the text rendering mode 7 of a PDF. A text cannot be in one path with other shapes, as a text object holds no path and clip paths do not add up, so the texts of a clipPath that has shapes too are left out, and the glyphs of a text clip by the nonzero rule, whatever its clip-rule. The shapes of a clipPath of several are one path, their union, by the nonzero rule, so a clip-rule of evenodd is drawn only in a clipPath of one shape: clip paths in a PDF only intersect and a path has one rule, so even-odd shapes in one union would have to be cut where they cross, and a soft mask, which PDF/A-1 forbids, is not used for it. It throws for a file that nests what it draws more than 48 deep, or that draws more than 4,000,000 path operations again, by use elements, markers and clip paths, or reads more than 20,000,000 characters of attributes again for them.
- ShapedLine
A line of text a shaper shaped: the part of the text it holds, and its glyphs, each with its font and its place.
- ShapingRequest
What a shaper is asked to shape: the text, its language, the font files, the font size and the width of the lines. One object, so that what a shaper is told can grow without changing the IShaper interface.
- SimpleBarChart
A small chart of horizontal bars that compares a few values: a name at the left of each bar, the value at its end, and no axis, grid or legend, on a light panel, with a title and a subtitle at the top. One bar can be highlighted, in navy, its name and value bold, as the best of the values: the bar of an index, or the lowest or the highest value, which the chart finds. Each bar is as long as its share of the largest value. A dashed line can mark a value across the bars, a target or an average, and the bars can have rounded ends.
It is meant to stand beside a Table of the same numbers: the chart for the picture, the table for the record and for a screen reader. In a PDF/UA document the chart is one figure, described from its title and its values unless an alternate description is set. For grouped, stacked or vertical bars with an axis, use BarChart. Please see Example_20.
- SimpleLineChart
A chart of a few lines over time, or over any categories in their order: the categories left to right, each line labeled at its right end with its name and its last value, so that it needs no legend; one line highlighted in navy, its label bold, the others gray. A light horizontal grid alone, no border, on a light panel, with a title and a subtitle at the top left, in the look of SimpleBarChart and SimpleScatterChart. A value that is NaN leaves a gap in its line. A value outside a range that is set cuts its line at the edge of the plot, and the chart says how many are: "2 values outside the range", small, under the plot at its right end, and in its description, in that alone when the plot would not be left room to draw.
In a PDF/UA document the chart is one figure, described from its data: the lines, their first and last values and their highest, and the values outside a range, unless an alternate description is set, which is then followed by those values alone. It draws with the page alone, and needs no other chart. Please see Example_25.
- SimpleScatterChart
A chart of points on two axes that shows how two values go together: many points as small gray dots, a little transparent so that a cluster shows darker, a few of them highlighted, navy and labeled with their names beside them, and the trend line of the points if asked, labeled at its end. A light horizontal grid alone, no border or legend, on a light panel, with a title and a subtitle at the top left, in the look of SimpleBarChart. Any point can be a link, a dot with a description that a hover or a screen reader gets, so that all of 200 points are links without a name printed for each. A point outside a range that is set is not drawn, and the chart says how many are: "2 points outside the range", small, under the plot at its right end, and in its description, in that alone when the plot would not be left room to draw.
In a PDF/UA document the chart is one figure, described from its data: the number of points, the highlighted ones and their values, which way the trend goes and the points outside a range, unless an alternate description is set, which is then followed by those points alone. It draws with the page alone, and needs no other chart. In PDF/A-1, which has no transparency, the dots are drawn opaque. Please see Example_26.
- SourceSerif4
The Source Serif 4 fonts, which PDFjet does not carry from 9.1.7: each constant is the path of a font file of the packages of PDFjet before 9.1.7, which the Font constructor that takes a font path reads when the file is there.
- SquareAnnotation
A square annotation.
- Stamp
Content that is drawn once with the path and text methods of this class, written to the document as a PDF form XObject by Complete, and placed on pages with DrawOn, at a location, a rotation and a scale, as a Container is.
What a stamp is good at: the content is in the file once, and each placement is the q, the transform and the Do that name it -- 83 bytes for a 200 by 50 point box with two lines of text, against the 367 a Container writes into every page for the same drawing. From the fourth page on the stamp is the smaller of the two: over 100 pages it saves 12,855 bytes of a 104,530 byte file, and over 500 pages 66,052 of 275,553. The whole stamp is one structure element in a PDF/UA document, with the alternate description, the language and the actual text it is given, which is what a logo or a watermark wants. A stamp given neither is an artifact, decoration; but drawn between the AddBDC and the AddEMC of real content, such as a paragraph whose letters are stamps, each drawn once and placed wherever it appears, it is part of that content, read as its actual text.
What it costs: a stamp draws with the methods of this class -- MoveTo, LineTo, CurveTo, DrawRect, FillRect and DrawText -- and holds no drawable of its own, so it has no images, no annotations, no tables and no barcodes. Its text needs a font that is embedded in the document: a core font and a CJK font are refused, since a stamp has no map from their characters to their glyphs. It has to be completed before it is drawn, and completed once. On fewer than four pages it is the larger of the two, since its XObject costs about 300 bytes of its own.
Use a Container instead to group drawable elements -- Rect, TextLine, Image, Table, a chart, a barcode, an annotation -- that are moved, rotated and scaled together, and to lay a group out once for one page. A container can hold a stamp, so a header written once can be placed inside a group that is rotated with the rest of it.
Please see Example_31.
- Table
Used to create table objects and draw them on a page. A Table is for cells that need more than a line of text: text that wraps, an image, a barcode or a chart in a cell, cells that span columns or rows, page totals, a style for each cell. For a long table of plain one-line rows, BigTable is faster and keeps its memory flat.
Please see Example_20.
- Tabloid
Used to specify PDF page with size Tabloid. For more information about the page size classes - A3, A4, A5, B5, JISB5, Executive, Letter, Legal and Tabloid - see the Page class.
- TextAnnotation
A text note annotation.
- TextBlock
A block of text that wraps at its width, with an optional border, background and padding. Without a height the block is as tall as its text; with one the text that does not fit is cut, and the lines are aligned to the top, the center or the bottom of the block.
Use a TextBlock for one run of text in one font: a label, a note, a table cell or a paragraph in a box. It breaks words that do not fit on a line, wraps right to left and Thai text, highlights keywords and can be cut to a height. Use a TextColumn for paragraphs of TextLine objects that differ in font or color, for justified text or for a rotated column, and a TextFrame for text that flows from one frame to the next. See Example_01, 10 and 11.
- TextColumn
A column of paragraphs, each a list of TextLine objects that can differ in font, size and color, aligned left, right, center or justified, with a line spacing, a paragraph spacing and an optional line between the paragraphs. It draws all of its paragraphs where it is placed, top down; to rotate a column, add it to a Container and rotate that.
Use a TextColumn for an article or a page of mixed text: bold or colored words in a paragraph, justified paragraphs, CJK paragraphs. Use a TextBlock for one run of text in one font, and a TextFrame when the text must continue from one frame to the next, across columns or pages. Please see Example_12, Example_13 and Example_16.
- TextFlow
Headings, paragraphs and images flowed onto as many pages as they need, one below the other between the margins: a report, a manual, a long letter. Paragraphs break across pages between their lines, as a TextFrame breaks them; an image goes whole, to the top of the next page when it does not fit below the text, with its caption; a heading goes to the next page with what follows it rather than end a page. The pages are created detached and added to a list, so that a footer or a page number can be drawn on each before they are added to the PDF.
Use a TextFrame to place text by hand, in frames on the same page or on others, the text flowing from one to the next; use TextFlow to pour the text and the images in, page after page. The order they are added in is the reading order of a PDF/UA document: the paragraphs are tagged as a TextFrame tags them, the images as figures with their alternate descriptions. Use Markdown instead for a text written in Markdown. Please see Example_22.
- TextFrame
Paragraphs of text lines, wrapped at the width of the frame, with an optional border. A frame with a height draws as much of the text as fits and keeps the rest for the next frame, so text flows from frame to frame. A frame without a height draws all of the text. Drawing consumes the text: a second DrawOn draws what is left, so build a new frame to draw the same text again.
Use a TextFrame for text that continues from one frame to the next: the columns of an article, or the pages of a long text. Use a TextColumn to draw paragraphs in one place, with justified text or a rotation, and a TextBlock for one run of text in one font. Please see Example_14 and Example_15.
- TextLine
Used to create text line objects.
- TextParameters
The font, font size, location and text for Stamp.DrawText.
- Title
Please see Example_41
- XMLException
The document is not the XML that XMLParser reads; the message says where.
- XMLNode
An element of an XML document that XMLParser read: its name, its attributes, its text and the elements in it.
The elements are found by a path of the names without their prefix, such as "SupplyChainTradeTransaction/ApplicableHeaderTradeAgreement/BuyerReference", because the prefixes of an invoice are its own: what one writes as ram:ID another writes as a:ID. A * matches an element of any name.
- XMLParser
Reads XML into elements: their names, their namespaces, their attributes in the order they are written, and their text. It is the one parser of the four ports and of PDFjet Pro, which reads its electronic invoices with it, and SVGImage its images, so that they read a document alike. It reads what such a document is made of and no more, and what it leaves out is what makes XML dangerous to read:
- A document type declaration, a DOCTYPE, is refused by Parse, and skipped by ParseSkippingDoctype, as the files of the drawing programs have one; either way its entities are not read: an entity that names a file or a URL reads what it should not, and the ones that stand for each other grow a short document into gigabytes.
- The entities are the five of XML, <, >, &, " and ', and the numeric ones, such as   and  . Any other is an error, the ones a DOCTYPE declares among them.
- The elements nest MAX_DEPTH levels at most, and the reading does not recurse, so no document overflows the stack.
- The document is 20 MB at most, and has MAX_ELEMENTS elements at most.
- The namespaces are looked up in the elements that declare them, from the innermost out, and not copied into each element, so that no number of declarations makes the reading slower than the length of the document times its depth.
- Nothing is fetched, and no schema is read.
What is read is XML, and what is not is an error: a character that XML does not have, such as U+0000 or U+FFFF, written or as an entity; an attribute written twice, or not after a space; and a prefix that no element declares. A line break is a line feed, as XML reads a carriage return and the line feed after it, and the tabs and line breaks in the value of an attribute are spaces, as XML normalizes them.
The document is UTF-8, or UTF-16 when it starts with a byte order mark; another encoding in the declaration is an error. The bytes that are not valid UTF-8 are the character U+FFFD, one for each part of a sequence that is as much of a character as it is valid for, which is what the Unicode Standard recommends and the decoder of .NET does.
Interfaces
- IBaselineDrawable
A drawable whose location is the baseline of its text, not the top left corner of a box: a line of text, such as TextLine and CompositeTextLine.
A Cell draws such a drawable where it draws its own text, on the baseline that its vertical alignment asks for, and makes room for the ascent and the descent below. A drawable that is not one of these is placed by its top left corner, at the padding of the cell.
- IDrawable
Interface that is required for components that can be drawn on a PDF page as part of Optional Content Group.
- IHarfBuzz
The engine under a HarfBuzzShaper: it shapes runs of text, each in one font, as HarfBuzz does. HBShape is one, which runs hb-shape; the NuGet package PDFjet.HarfBuzz gives another, HarfBuzz itself through HarfBuzzSharp, with nothing to install.
- IShaper
A text engine that shapes text for TextBlock and TextLine: it wraps the text to a width and finds, for each line, the glyphs of the fonts and their places. PDFjet does not shape scripts such as Hindi and Khmer itself; a shaper does, and PDFjet draws what it found, as outlines. .NET has no text engine of its own that gives glyphs: the NuGet package PDFjet.HarfBuzz gives PDFjet HarfBuzz, nothing to install; SetShaper gives another, such as HBShape, which runs HarfBuzz's program hb-shape, used only when set.
Enums
- Alignment
Used to specify the horizontal and vertical alignment, for example of the text in a Cell, TextBlock, Paragraph or TextColumn.
- BlendMode
The blend modes of a graphics state: how what is drawn is mixed with what is already on the page. MULTIPLY, for example, draws like a highlighter pen that leaves the text under it readable. See the GraphicsState class.
- CJKFont
Used to select Chinese, Japanese or Korean fonts.
- CapStyle
Used to specify the cap style of a line. See the Line class for more information.
- Compliance
Used to set PDF/A compliance. See the constructors in the PDF class.
- Direction
The direction a Barcode is drawn in.
- ErrorCorrectionLevel
Used to specify the error correction level for QR Codes. The values are the bits of the level in the format information.
- JoinStyle
Used to specify the join style when joining two lines. See the Page and Line classes for more details.
- PageLayout
Used to specify the PDF page layout.
- PageMode
Used to specify the PDF page mode.
- PathOperator
The operators that paint a path, for example in Page.DrawPath.
- Relationship
Says how a file attached to the document relates to what the document shows. A document of PDF/A-3 names one for each file it carries, and a reader shows it to the person who opens the document.
- ScriptPosition
Used to specify whether text is drawn as normal text, as a subscript or as a superscript.
- Shape
The shape of the marker drawn at a Point.
- StructElem
The structure element types of a tagged (PDF/UA) document, as in ISO 32000-1 section 14.8.4. A TextLine is a P by default; see TextLine.SetStructureType.
- UserAccess
Represents the user access permissions for an encrypted PDF document as defined in ISO 32000-2 (PDF 2.0) Table 22. Permissions are stored as flags in a 32-bit integer, whose bit positions are numbered from 1, the low-order bit.
Delegates
- TextFrame.Listener
Told of each line of text as the frame draws it: the line as drawn, its text, font, size and color, at x, the left of its first letter, and y, its baseline; and the text line of the paragraph it is a piece of, or null for a list's label, so that a program can tell which of its text a point on the page is (hit testing). The pieces of a source are drawn in the order of its text, whole words, or a word cut at a soft hyphen (ending with a hyphen) or where it does not fit.
Two things to know when matching the pieces with their sources: a space at the start of a text line (before a bold word, say) is drawn at the end of the piece before it, so it comes with the source before; and a word's soft hyphens (U+00AD) where it is not broken stay in the text of its piece, drawn as nothing.