Regarding to the enhancement in Printing Framework, a native PDF renderer is added to convert PDF to a bitmap, which can be used for print preview, according to Chet Haase.
A typical use of the APIs to render a PDF looks like this:
// create a new renderer PdfRenderer renderer = new PdfRenderer(getSeekableFileDescriptor()); // let us just render all pages final int pageCount = renderer.getPageCount(); for (int i = 0; i < pageCount; i++) { Page page = renderer.openPage(i); // say we render for showing on the screen page.render(mBitmap, null, null, Page.RENDER_MODE_FOR_DISPLAY); // do stuff with the bitmap // close the page page.close(); } // close the renderer renderer.close();The Android L preview image can be downloaded from the Android developer website:
Device | Download | Checksum |
---|---|---|
Nexus 5 (GSM/LTE) "hammerhead" | hammerhead-lpv79-preview-ac1d8a8e.tgz | MD5: 5a6ae77217978cb7b958a240c2e80b57 SHA-1: ac1d8a8e4f4a1dca5864dc733caa940bffc28616 |
Nexus 7 (Wifi) "razor" | razor-lpv79-preview-d0ddf8ce.tgz | MD5: b293a5d3a4e07beabebcc0be85ad68a2 d0ddf8ce733ba2a34279cdff8827fd604762c2342d |
- Download the appropriate system image for your device below, then unzip it to a safe directory.
- Connect your device to your computer over USB.
- Start the device in fastboot mode with one of the following methods:
- Using the adb tool: With the device powered on, execute:
adb reboot bootloader
- Using a key combo: Turn the device off, then turn it on and immediately hold down the relevant key combination for your device. For example, to put a Nexus 5 ("hammerhead") into fastboot mode, press and hold Volume Up + Volume Down + Power as the device begins booting up.
- Using the adb tool: With the device powered on, execute:
- If necessary, unlock the device's bootloader by running:
fastboot oem unlock
The target device will show you a confirmation screen. (This erases all data on the target device.) - Open a terminal and navigate to the unzipped system image directory.
- Execute the
flash-all
script. This script installs the necessary bootloader, baseband firmware(s), and operating system.
No comments:
Post a Comment