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);
Arguments:
pages
- a list of valid Page objects. Eachpage
should have the cropped DOCUMENT image.options
-PdfRenderingOptions(PdfRenderSize renderPageSize)
- [pageSize] enum value to specify the output page size.
- [pageDirection] page orientation eg portrait, landscape or automatic.
- [pdfAttributes] attributes of pdf file. Author, title, etc.
class PdfRenderingOptions {
/// 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;
}
/// The page size of the pdf document.
enum PageSize {
/// 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,
}
/// The PDF file attributes.
class PdfAttributes {
/// 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.