getPdf method
This method outputs a nullable Uint8List representing the Widget wrapped by CaptureBox in the form of a PDF mime type.
If there is no Widget attached or if an error occurs during the convertion, this
method returns null
.
Implementation
Future<Uint8List?> getPdf({
PdfPageMode pageMode = PdfPageMode.thumbs,
bool compress = false,
PdfVersion pdfVersion = PdfVersion.pdf_1_5,
PdfPageFormat pageFormat = PdfPageFormat.undefined,
pdf_widgets.PageOrientation? pageOrientation,
String? title,
String? author,
String? creator,
String? subject,
String? keywords,
String? producer,
}) async {
Uint8List? pngByteList = await getPng();
if(pngByteList != null) {
return await _pngToPdf(
pngByteList,
pageMode: pageMode,
compress: compress,
pdfVersion: pdfVersion,
pageFormat: pageFormat,
pageOrientation: pageOrientation,
title: title,
author: author,
creator: creator,
subject: subject,
keywords: keywords,
producer: producer
);
}
return null;
}