QuestPDF

QuestPDF is a modern open-source .NET library for PDF document generation. Offering comprehensive layout engine powered by concise and discoverable C# Fluent API. Easily generate PDF reports, invoices, exports, etc.

OTHER License

Stars
11.7K
Committers
32

Bot releases are hidden (Show)

QuestPDF - 2022.2.7

Published by MarcinZiabek over 2 years ago

Fixed text rendering issue: spaces in nested text spans are not rendered correctly.

QuestPDF - 2022.2.6

Published by MarcinZiabek over 2 years ago

#135 Fixed a rare corner case when drawing a text can result with a DocumentLayoutException.

QuestPDF - 2022.2.5

Published by MarcinZiabek over 2 years ago

Bug fixes:

  • #122 the ScaleToFit element does not work properly when one of the dimensions (width or height) is not constrained,
  • #123 fixed a rare issue when part of the text is not rendered,
  • #124 fixed a rare situation the LineVertical and LineHorizontal elements which sometimes are not measured correctly (floating-point number rounding error),
  • #52 reverted back the change that allows directly streaming to ASP Response.Body stream. This change appears to be unstable and can cause a FatalException.
QuestPDF - 2022.02

Published by MarcinZiabek over 2 years ago

  • Added a ScaleToFit element - scales its child down so it fits in the provided space,
  • Added a StopPaging element - when its child requires more than one page to fully render, only the first page is shown,
  • Added a 'LineVertical' and a 'LineHorizontal' elements - those will simplify your code a lot, there is no need to use the Border element anymore!
  • Renaming: the Stack element was renamed to the Column element,
  • Renaming: children of the Row element are now called items instead of columns, e.g. RelativeItem instead of RelativeColumn,
  • Added support of the AutoItem to the Row element - those items take as little width as possible,
  • Extended Fluent API to support new unit types, e.g. inches,
  • Improved default Fluent configuration behavior for elements: Scale, Padding, Translate,
  • Improved integration support with the HttpContext.Response.Body. This improvement was introduced by schulz3000, thank you!
QuestPDF - 2022.01

Published by MarcinZiabek almost 3 years ago

Introduced new element: Table - a great way to construct complex document structures, e.g. reports. This element covers all cases offered by the combination of the Stack and the Row elements. Additionally, it provides support for more complex layouts and corner cases. Updating to the Table element can greatly simplify your code 😁

Other changes:

  • Added new element DefaultTextStyle - it allows set new text style to all its children,
  • Improved the default paging behaviour for the Row element. In some minor corner cases it might cause infinite layout exceptions and confuse developers. This improvement was suggested by SvizelPritula, thank you!
  • Fixed default page sizes for: Letter and Legal. This improvement was introduced by markhewett, thank you!
  • Documentation: added article on how to run QuestPDF on in Blazor Webassembly. This article was written by pablopioli, thank you!
  • Other library / documentation improvements.
QuestPDF - 2021.12

Published by MarcinZiabek almost 3 years ago

  • Improved debugging experience for layout-related exceptions. To make the library predictable, it is (by design) very strict about layouting rules and throws an exception when a constraint cannot be met. In this release, each exception contains an element stack that contains all information needed to identify the issue. By default, this feature is enabled only when debugger is attached.
  • Improved layouting algorithm performance by introducing additional caching layer. This cache reduces the layouting time by half. By default, this feature is enabled only when debugger is not attached (mostly release mode).
  • Reduced GA pressure put by the layouting algorithm. Previously, every element measurement operation was represented by an object and the paging support was done via class hierarchy. New solution uses structs (which are value-types) and enums. This also makes the code more readable and easier to follow.
  • Added support for generating XPS files which are easier to print in the Windows environment. This was possible due to existing support in SkiaSharp. This change was proposed by sbrkich, thank you!
QuestPDF - 2021.11

Published by MarcinZiabek almost 3 years ago

  • Added new Inlined element - put block elements along a line with line-breaking and page-breaking support. This element also supports various element placement in the horizontal axis as well as the baseline. It will help me in the future development, especially with text rendering optimization,
  • Introduced a new SkipOnce element - it can be used to hide content on the first occurrence of the parent. Useful in conjunction with the ShowOnce element. This change was proposed by jcl86, thank you!
  • Improved debugging experience by providing more detailed message when the DocumentLayoutException is thrown. This improvement is based on the discussion started by preiius, thank you!
  • Now it is possible to specify global, document-specific text style. This improves text style management and simplifies the typography pattern. This feature was proposed by JonnyBooker, thank you!
  • Added two overloads to the Image element. Now, you can provide an image as a filePath or a Stream. This improvement was suggested by pha3z. Thank you!
  • Improved text rendering performance.
  • Improved documentation examples for the ShowOnce and the EnsureSpace elements.
  • Improved text element: it does not throw an exception when an argument is null.
  • All new releases of QuestPDF will contain symbol packages. Let's welcome simplified debugging experience 🎉
QuestPDF - 2021.10.0

Published by MarcinZiabek about 3 years ago

This update is focused on text rendering capabilities:

  • text paging support,
  • text background,
  • text stroke,
  • text underline,
  • changing text style within a run (e.g. size, font type, color),
  • inserting links in text,
  • inserting custom components in text, e.g. an image,
  • inserting page numbers in text (current page, total pages, page of location),
  • layouting engine uses now more font-related metadata when rendering text (e.g. ascent, descent properties),
  • increased rendering performance by introducing short-living cache.

Additionally, the test coverage has been highly increased. No new bugs have been found :)

QuestPDF - 2021.9.3

Published by MarcinZiabek about 3 years ago

Fixed detecting infinite layout exception in certain cases

QuestPDF - 2021.9.2

Published by MarcinZiabek about 3 years ago

Fixed: continuous page setting does not work properly.
Improved: exception message when overriding existing content.

QuestPDF - 2021.9

Published by MarcinZiabek about 3 years ago

Added support for registering custom fonts from a stream.

QuestPDF - 2021.08

Published by MarcinZiabek about 3 years ago

This release mostly introduces a couple of additions requested by the QuestPDF community:

  • The ability to create documents with pages of various sizes, including continuous pages which are not restricted in height,
  • The PageNumber component supports now additional placeholders, such as total number of pages or page number of predefined locations. This addition is great for creating lists of content with interactive links,
  • Added new element: Unconstrained - it removes any size constraints and gives its child full freedom in terms of layout,
  • Added new elements: Scale, ScaleHorizontal and ScaleVrtical - they allow to change the scale of an included child, making content inside bigger or smaller than it will appear otherwise,
  • Added new elements: FlipOver, FlipHorizontal and FlipVertical - they allow to create a mirror image of the content in one or both axes,
  • Added new elements: RotateLeft and RotateRight - they allow to rotate the content by 90 degrees to the left or to the right, preserving space constraints,
  • Added new element: Rotate(degrees) - it allows to rotate its content. Important: this element does not preserve space constraints and elements put inside may be placed over other elements,
  • Added new elements: TranslateX and TranslateY - they allow to move content in both axes, preserving size constraints.

Additionally, this release includes some improvements to the engine used for generating code examples and their results. In the future, it will simplify creating examples and therefore will allow creating better documentation.

Breaking changes:

  1. PageNumber - the default placeholder storing current page number has changed. Please replace your code following this patter:
// change from:
.PageNumber("Page {number}")

// to:
.PageNumber("Page {pdf:currentPage}")
  1. The page settings are defined slightly differently. The page size is no longer defined in the DocumentMetadata class. The page margins have now predefined fluent API methods and do not rely on the padding element anymore. Please refer to the Getting Started section to see where this information should be placed.
QuestPDF - 2021.05

Published by MarcinZiabek over 3 years ago

This release is the biggest one so far, offering a handful of new features and helpers:

  • Added new element: Box - it does not enforce parent size to its child,
  • Added new element: Grid - allows putting elements on the grid layout. Each element can take various number of columns. To big items will be moved to the next row,
  • Added new element: Canvas - allows drawing custom content using the SkiaSharp canvas element,
  • Added new element: EnsureSpace - makes sure that pageable content that according to the layout will take multiple pages, has enough space on each page,
  • Added new element: Layers - allows drawing content below and above the main layer, e.g. drawing text on top of the image,
  • Redesigned the Debug element - it does not only highlight space but also puts a small label,
  • Added set of predefined colors inspired by the Material Design system,
  • Added set of predefined fonts,
  • Improved the Row element - added spacing property similar to the one available in the Stack element,
  • Slightly adjusted available API (insignificant breaking changes).
QuestPDF -

Published by MarcinZiabek over 3 years ago

  1. Added new element: Debug - this element can be used for inspecting its children and space taken by them,
  2. Added new element: Element can be used for injecting dynamic elements (usually conditionally) without breaking the fluent API chain. This is practically a syntactic sugar to simplify your code.
  3. The AspectRatio element allows now to specify scaling rule: fitting width, height or available space.
  4. The Image element supports now scaling rules: fitting width, height or available space, as well as scaling unproportionally.
  5. Added more, commonly used page sizes (thank you for your work lmingle).
  6. Bugfix: the GeneratePdf(Stream stream) method does not close the output stream (thank you for your suggestion tthiery).
QuestPDF -

Published by MarcinZiabek over 3 years ago

Fixed TextStyle mutating when using Alignment extension methods.

QuestPDF - 2021.3

Published by MarcinZiabek over 3 years ago

Added new element: ShowIf can be used for conditionally showing/hiding elements without using c# if-statement. This is practically syntactic sugar to simplify your code.

Usability improvement: fluent API for changing text style does not mutate original style anymore, creates a copy instead with applied change.

Added possibility to render the document as a set of images.