Creating PDF Documents | Flutter Document Scanner
PDF Creation
ScanbotSdk.createPdf(pages, options)
The Scanbot SDK renders given page images into a multi-page PDF document and stores it as a file. For each DOCUMENT image a separate page is generated.
List<Page> pages = ...
var options = PdfRenderingOptions(pageSize: PageSize.A4);
Uri pdfFileUri = await ScanbotSdk.createPdf(pages, options);
pages
- a list of valid Page objects. Eachpage
should have the cropped DOCUMENT image.options
-PdfRenderingOptions()
PdfRenderingOptions
Click to expand properties
/// The direction of the page in the PDF document.
final PageDirection pageDirection;
/// The size of the page in the PDF document.
final PageSize pageSize;
/// The PDF document attributes.
final PdfAttributes pdfAttributes;
final PageFitMode pageFitMode;
final int dpi;
final bool resample;
final int jpegQuality;
const PdfRenderingOptions(
{this.pageSize = PageSize.CUSTOM,
this.pageDirection = PageDirection.AUTO,
this.pageFitMode = PageFitMode.FIT_IN,
this.dpi = 72,
this.jpegQuality = 80,
this.resample = true,
this.pdfAttributes = const PdfAttributes(
creator: "",
author: "",
title: "",
subject: "",
keywords: "",
)});
PageSize
The page size of the pdf document.
Click to expand properties
/// Letter page size. */
LETTER,
/// Legal page size. */
LEGAL,
/// A3 page size. */
A3,
/// A4 page size. */
A4,
/// A5 page size. */
A5,
/// B4 page size. */
B4,
/// B5 page size. */
B5,
/// Executive page size. */
EXECUTIVE,
/// US4x6 page size. */
US4x6,
/// US4x8 page size. */
US4x8,
/// US5x7 page size. */
US5x7,
/// COMM10 page size. */
COMM10,
/// Custom page size. From the Image. */
CUSTOM,
PdfAttributes
The PDF file attributes.
Click to expand properties
/// The creator of the PDF document.
final String creator;
/// The author of the PDF document.
final String author;
/// The title of the PDF document.
final String title;
/// The subject of the PDF document.
final String subject;
/// The keywords of the PDF document.
final String keywords;
Want to scan longer than one minute?
Generate a free trial license to test the Scanbot SDK thoroughly.
Get your free Trial LicenseWhat do you think of this documentation?
What can we do to improve it? Please be as detailed as you like.