1 CDD GENERATION README 2 ===================== 3 4 The HTML CDD is generated via build script from the source files in the 5 platform/compatibility/cdd component. See the README in that component for 6 details. Once the HTML is generated, then it is copied to this directory and the 7 PDF is generated using the procedure given below. 8 9 PDF GENERATION 10 ============== 11 12 OVERVIEW 13 ================== 14 This section describes how to create a CDD PDF from the CDD HTML file. You need to generate a cover file and a body file, then use a PDF editor to insert the cover page into the body.pdf. 15 16 The Android Compatibilty Definition Document (CDD) is maintained as an html file but distributed as a .pdf. The partner team updates the CDD for every new major Android release and the APE doc team posts the new .pdf to source.android.com in http://source.android.com/compatibility/. 17 18 To create the pdf from the html file, use wkhtmltopdf (http://wkhtmltopdf.org/) plus a little bit of PDF editing. You can do the conversion on a Mac or Linux (or even Windows); you just need to download the wkhtmltopdf pkg for your system. However, you must perform the editing in a professional PDF editor; for Mac and Windows this is Adobe Acrobat Pro; for Linux this is PDF Studio 10 (none of the free Linux PDF apps can do the swap successfully and still maintain the PDF bookmarks and links). 19 20 21 1. INSTALL WKHTMLTOPDF 22 ======================= 23 Go to http://wkhtmltopdf.org/ and download the app for your system OS. It's command line only. 24 25 26 2. GENERATE COVER PDF 27 ======================= 28 29 Syntax: 30 31 wkhtmltopdf [page-size] [page-margins] cover path-to-html path-to-pdf 32 33 page-size 34 Set to letter. 35 Ex. -s letter 36 37 page-margins 38 set to 0in (cover goes all the way to page edges) 39 Ex. -B 0in -T 0in -L 0in -R 0in 40 41 path-to-html 42 The full path to the cover html file. You will need to update the cover text to specify the release name , number, and date. You might also need to swap the image out for the image associated with the release (store images in compatibility/images). 43 Ex: docs/source.android.com/src/compatibility/5.1/android-cdd-cover_5_1.html 44 45 path-to-pdf 46 The full path to where you want the output pdf file to reside. If the pdf file is NOT open (in Preview or some other app), running the command will silently overwrite the existing .pdf. 47 Ex. docs/source.android.com/src/compatibility/5.1/android-cdd-cover.pdf 48 49 Example cover command run from top-level project: 50 wkhtmltopdf -s letter -B 0in -T 0in -L 0in -R 0in cover docs/source.android.com/src/compatibility/5.1/android-cdd-cover_5_1.html docs/source.android.com/src/compatibility/5.1/android-cdd-cover.pdf 51 52 Example cover command run from 5.1 release folder: 53 wkhtmltopdf -s letter -B 0in -T 0in -L 0in -R 0in cover android-cdd-cover_5_1.html /android-cdd-cover.pdf 54 55 56 3. GENERATE BODY PDF 57 ==================== 58 Syntax: 59 60 wkthmltopdf [page-margins] page path-to-html path-to-footer path-to-pdf 61 62 page-margins 63 set to 1in on top and bottom, .75in on left and right. 64 Ex. -B 1in -T 1in -L .75in -R .75in 65 66 path-to-html 67 The full path to the body html file. This is the main cdd.html, which will change with each release. 68 Ex. docs/source.android.com/src/compatibility/5.1/android-5.1-cdd.html 69 70 path-to-footer 71 The full path to the footer html file. This is a simple html file that contains the android logo and some javascript to calculate the page number and count. The footer should NOT change from release to release. 72 Ex. --footer-html docs/source.android.com/src/compatibility/5.1/android-cdd-footer.html 73 74 path-to-pdf 75 The full path to where you want the output pdf file to reside. If the pdf file is NOT open (in Preview or some other app), running the command will silently overwrite the existing .pdf. 76 Ex. docs/source.android.com/src/compatibility/5.1/android-cdd-body.pdf 77 78 Example body command run from top-level project: 79 wkhtmltopdf -B 1in -T 1in -L .75in -R .75in page docs/source.android.com/src/compatibility/5.1/android-5.1-cdd.html --footer-html docs/source.android.com/src/compatibility/5.1/android-cdd-footer.html docs/source.android.com/src/compatibility/5.1/android-cdd-body.pdf 80 81 Example body command run from 5.1 release folder: 82 wkhtmltopdf -B 1in -T 1in -L .75in -R .75in page android-5.1-cdd.html --footer-html android-cdd-footer.html android-cdd-body.pdf 83 84 4. CREATE CDD PDF 85 ================== 86 A. Open the body.pdf: 87 On a Mac or Windows, use Adobe Acrobat Pro (you *cannot* use Acrobat Reader for this task). 88 On Ubuntu, use PDF Studio 10 (other free pdf programs *cannot* handle the merge + bookmarks). 89 B. Replace page 1 of the body.pdf with page 1 of the cover.pdf. For example, if you are using Adobe Acrobat Pro: 90 1. Open the body.pdf in Adobe Acrobat Pro. 91 2. Select Tools > Pages > Replace. 92 2. Open the cover.pdf file. 93 3. Replace page 1 of the body.pdf with page 1 of the cover.pdf. 94 C. Save the new file as the android-cdd_x_x.pdf (where X_X is the number of the release, such as 5.1). 95 96 QUESTIONS? 97 ================== 98 - For details on wkhtmltopdf, see http://wkhtmltopdf.org/usage/wkhtmltopdf.txt. 99 - CDD html, css, and pdf files are in docs/source.android.com/src/compatibility/release. 100 - CDD images are in docs/source.android.com/src/compatibility/images. 101