![]() |
Pangolin
Header-only C++20 plane computational geometry library
|
Trimmed header-only C++ port of PDFGen for Pangolin canvas export. More...
#include <algorithm>#include <array>#include <cerrno>#include <cmath>#include <cstdarg>#include <cstdint>#include <cstdio>#include <cstring>#include <ctime>#include <fstream>#include <memory>#include <sstream>#include <string>#include <string_view>#include <utility>#include <vector>Go to the source code of this file.
Classes | |
| struct | pgl::pdfgen::pdf_info |
| struct | pgl::pdfgen::pdf_path_operation |
| struct | pgl::pdfgen::pdf_object |
| struct | pgl::pdfgen::pdf_doc |
Namespaces | |
| namespace | pgl |
| namespace | pgl::pdfgen |
| namespace | pgl::pdfgen::detail |
Functions | |
| constexpr float | pgl::pdfgen::PDF_INCH_TO_POINT (float inch) |
| constexpr float | pgl::pdfgen::PDF_MM_TO_POINT (float mm) |
| constexpr std::uint32_t | pgl::pdfgen::PDF_RGB (unsigned int r, unsigned int g, unsigned int b) |
| constexpr std::uint32_t | pgl::pdfgen::PDF_ARGB (unsigned int a, unsigned int r, unsigned int g, unsigned int b) |
| constexpr float | pgl::pdfgen::PDF_RGB_R (std::uint32_t colour) |
| constexpr float | pgl::pdfgen::PDF_RGB_G (std::uint32_t colour) |
| constexpr float | pgl::pdfgen::PDF_RGB_B (std::uint32_t colour) |
| constexpr bool | pgl::pdfgen::PDF_IS_TRANSPARENT (std::uint32_t colour) |
| int | pgl::pdfgen::detail::ascii_casecmp (std::string_view left, std::string_view right) |
| void | pgl::pdfgen::detail::append_format (std::string &out, const char *format,...) |
| void | pgl::pdfgen::detail::append_escaped_string (std::string &out, std::string_view value) |
| std::string | pgl::pdfgen::detail::now_as_pdf_date () |
| int | pgl::pdfgen::pdf_set_err (pdf_doc *doc, int errval, const char *buffer,...) |
| const char * | pgl::pdfgen::pdf_get_err (const pdf_doc *pdf, int *errval) |
| void | pgl::pdfgen::pdf_clear_err (pdf_doc *pdf) |
| pdf_object * | pgl::pdfgen::pdf_get_object (const pdf_doc *pdf, int index) |
| pdf_object * | pgl::pdfgen::pdf_find_first_object (const pdf_doc *pdf, int type) |
| pdf_object * | pgl::pdfgen::pdf_find_last_object (const pdf_doc *pdf, int type) |
| int | pgl::pdfgen::pdf_append_object (pdf_doc *pdf, pdf_object *object) |
| pdf_object * | pgl::pdfgen::pdf_add_object (pdf_doc *pdf, int type) |
| float | pgl::pdfgen::pdf_width (const pdf_doc *pdf) |
| float | pgl::pdfgen::pdf_height (const pdf_doc *pdf) |
| float | pgl::pdfgen::pdf_page_width (const pdf_object *page) |
| float | pgl::pdfgen::pdf_page_height (const pdf_object *page) |
| int | pgl::pdfgen::pdf_set_font (pdf_doc *pdf, const char *font) |
| pdf_doc * | pgl::pdfgen::pdf_create (float width, float height, const pdf_info *info) |
| void | pgl::pdfgen::pdf_destroy (pdf_doc *pdf) |
| pdf_object * | pgl::pdfgen::pdf_append_page (pdf_doc *pdf) |
| pdf_object * | pgl::pdfgen::pdf_get_page (pdf_doc *pdf, int page_number) |
| int | pgl::pdfgen::pdf_page_set_size (pdf_doc *pdf, pdf_object *page, float width, float height) |
| int | pgl::pdfgen::pdf_add_stream (pdf_doc *pdf, pdf_object *page, const std::string &buffer) |
| std::string | pgl::pdfgen::pdf_escape_content_string (std::string_view value) |
| int | pgl::pdfgen::pdf_add_text (pdf_doc *pdf, pdf_object *page, const char *text, float size, float xoff, float yoff, std::uint32_t colour) |
| float | pgl::pdfgen::pdf_clamp_alpha (float alpha) |
| bool | pgl::pdfgen::pdf_alpha_equal (float left, float right) |
| int | pgl::pdfgen::pdf_find_or_create_ext_gstate (pdf_doc *pdf, pdf_object *page, float fill_alpha, float stroke_alpha) |
| int | pgl::pdfgen::pdf_add_line_pattern (pdf_doc *pdf, pdf_object *page, float x1, float y1, float x2, float y2, float width, std::uint32_t colour, const float pattern[], int pattern_len, float phase, float stroke_alpha=1.0f) |
| int | pgl::pdfgen::pdf_add_line (pdf_doc *pdf, pdf_object *page, float x1, float y1, float x2, float y2, float width, std::uint32_t colour, float stroke_alpha=1.0f) |
| int | pgl::pdfgen::pdf_add_cubic_bezier (pdf_doc *pdf, pdf_object *page, float x1, float y1, float x2, float y2, float xq1, float yq1, float xq2, float yq2, float width, std::uint32_t colour, float stroke_alpha=1.0f) |
| int | pgl::pdfgen::pdf_add_quadratic_bezier (pdf_doc *pdf, pdf_object *page, float x1, float y1, float x2, float y2, float xq1, float yq1, float width, std::uint32_t colour, float stroke_alpha=1.0f) |
| int | pgl::pdfgen::pdf_add_custom_path (pdf_doc *pdf, pdf_object *page, const pdf_path_operation *operations, int operation_count, float stroke_width, std::uint32_t stroke_colour, std::uint32_t fill_colour, float fill_alpha=1.0f, float stroke_alpha=1.0f) |
| int | pgl::pdfgen::pdf_add_ellipse (pdf_doc *pdf, pdf_object *page, float x, float y, float xradius, float yradius, float width, std::uint32_t colour, std::uint32_t fill_colour, float fill_alpha=1.0f, float stroke_alpha=1.0f) |
| int | pgl::pdfgen::pdf_add_circle (pdf_doc *pdf, pdf_object *page, float x, float y, float radius, float width, std::uint32_t colour, std::uint32_t fill_colour, float fill_alpha=1.0f, float stroke_alpha=1.0f) |
| int | pgl::pdfgen::pdf_add_rectangle (pdf_doc *pdf, pdf_object *page, float x, float y, float width, float height, float border_width, std::uint32_t colour, float stroke_alpha=1.0f) |
| int | pgl::pdfgen::pdf_add_filled_rectangle (pdf_doc *pdf, pdf_object *page, float x, float y, float width, float height, float border_width, std::uint32_t colour_fill, std::uint32_t colour_border, float fill_alpha=1.0f, float stroke_alpha=1.0f) |
| int | pgl::pdfgen::pdf_add_polygon (pdf_doc *pdf, pdf_object *page, const float x[], const float y[], int count, float border_width, std::uint32_t colour, float stroke_alpha=1.0f) |
| int | pgl::pdfgen::pdf_add_filled_polygon (pdf_doc *pdf, pdf_object *page, const float x[], const float y[], int count, float border_width, std::uint32_t colour, float fill_alpha=1.0f, float stroke_alpha=1.0f) |
| int | pgl::pdfgen::pdf_save_buffer (pdf_doc *pdf, std::string &out) |
| int | pgl::pdfgen::pdf_save_file (pdf_doc *pdf, FILE *fp) |
| int | pgl::pdfgen::pdf_save (pdf_doc *pdf, const char *filename) |
| std::string | pgl::pdfgen::pdf_to_string (pdf_doc *pdf) |
Variables | |
| constexpr float | pgl::pdfgen::PDF_LETTER_WIDTH = PDF_INCH_TO_POINT(8.5f) |
| constexpr float | pgl::pdfgen::PDF_LETTER_HEIGHT = PDF_INCH_TO_POINT(11.0f) |
| constexpr float | pgl::pdfgen::PDF_A4_WIDTH = PDF_MM_TO_POINT(210.0f) |
| constexpr float | pgl::pdfgen::PDF_A4_HEIGHT = PDF_MM_TO_POINT(297.0f) |
| constexpr float | pgl::pdfgen::PDF_A3_WIDTH = PDF_MM_TO_POINT(297.0f) |
| constexpr float | pgl::pdfgen::PDF_A3_HEIGHT = PDF_MM_TO_POINT(420.0f) |
| constexpr std::uint32_t | pgl::pdfgen::PDF_RED = PDF_RGB(0xffu, 0u, 0u) |
| constexpr std::uint32_t | pgl::pdfgen::PDF_GREEN = PDF_RGB(0u, 0xffu, 0u) |
| constexpr std::uint32_t | pgl::pdfgen::PDF_BLUE = PDF_RGB(0u, 0u, 0xffu) |
| constexpr std::uint32_t | pgl::pdfgen::PDF_BLACK = PDF_RGB(0u, 0u, 0u) |
| constexpr std::uint32_t | pgl::pdfgen::PDF_WHITE = PDF_RGB(0xffu, 0xffu, 0xffu) |
| constexpr std::uint32_t | pgl::pdfgen::PDF_TRANSPARENT = (0xffu << 24) |
| constexpr std::array | pgl::pdfgen::detail::valid_fonts |
Trimmed header-only C++ port of PDFGen for Pangolin canvas export.
Source: https://github.com/AndreRenaud/PDFGen Original license: The Unlicense / public domain. The upstream project states: "This is free and unencumbered software released into the public domain." This file is a trimmed and modified port for use inside pgl. Image loading, barcodes, TrueType embedding, encryption, bookmarks, and link annotations were removed; the retained subset covers document creation/serialization, pages, standard-font registration, and vector drawing primitives.