MAUI PDF Conversion Library

PSPDFKit for MAUI enables you to convert images to PDFs. For more information on the supported image formats, see the list of supported file types.

Image to PDF

To generate a PDF using images, follow the steps below.

  1. While loading a document, you can pass an asset path, a local path, a URL, a byte array, or a Base64 string of an image into the loading function:

var documentFromAsset = 
    await PSPDFKitController.LoadDocumentFromAssetsAsync(imageAssetPath);

var documentFromLocalStorage = 
    await PSPDFKitController.LoadDocument(imagePath);

var documentFromBuffer = 
    await PSPDFKitController.LoadDocumentFromBufferAsync(imageBuffer);

var documentFromBase64String = 
    await PSPDFKitController.LoadDocumentFromBase64StringAsync(imageAsBase64String);
    
var documentFromRemoteUrl = 
    await PSPDFKitController.LoadDocumentFromURLAsync(remoteImageURL);
  1. Optionally, make changes to the image. For example, add an annotation.

  2. To export a loaded image as a PDF, use the ExportDocumentAsync function:

var exportConfiguration = _document.CreateExportConfiguration();
var exportedDocumentAsPDF = await _document.ExportDocumentAsync(exportConfiguration);

When exporting a document, you have several options. Refer to our export configuration guide for more details.

  1. Save the output. The export method returns a byte array, which can be saved to a file or sent to a server.