Foxit PDF SDK for Android

How to print a PDF document using Foxit PDF SDK for Android?

Foxit PDF SDK for Android supports the print feature since version 5.1. You can press the Wireless Print button on the More Menu view in the Complete PDF viewer demo to print the PDF document. Furthermore, you can call the following API to print the PDF documents:

// for iPhone and iTouch
public void startPrintJob(Context context, PDFDoc doc, String printJobName, String outputFileName, IPrintResultCallback callback)

Following is a sample for how to use it:

// Assume you have already Initialized a UIExtensionsManager object
PDFDoc doc = null;
IPrintResultCallback print_callback = new IPrintResultCallback() {

@Override
public void printFinished() {
}

@Override
public void printFailed() {
}

@Override
public void printCancelled() {
}
};

try {
doc = new PDFDoc("/mnt/sdcard/input_files/Sample.pdf");
doc.load(null);
} catch (PDFException e) {
Assert.fail("unexpect a PDF Exception!!errCode = " + e.getLastError());
}
uiExtensionsManager.startPrintJob(getActivity(), doc, "print with name", "print_withAPI", print_callback);
}

Updated on August 29, 2018

Was this article helpful?
Thanks for your feedback. If you have a comment on how to improve the article, you can write it here: