Android.Graphics.Pdf Namespace


Contains classes for manipulation of PDF content.



java Example

 // create a new document
 PdfDocument document = new PdfDocument();

 // crate a page description
 PageInfo pageInfo = new PageInfo.Builder(new Rect(0, 0, 100, 100), 1).create();

 // start a page
 Page page = document.startPage(pageInfo);

 // draw something on the page
 View content = getContentView();

 // finish the page
 . . .
 // add more pages
 . . .
 // write the document content

 // close the document
PdfDocument+PageDocumentation for this section has not yet been entered.
PdfDocument+PageInfoDocumentation for this section has not yet been entered.
PdfDocument+PageInfo+BuilderDocumentation for this section has not yet been entered.

Print preview and print output

  • Respect the property whether the document would like to be scaled for printing as per Android.Graphics.Pdf.PdfRenderer.ShouldScaleForPrinting.
  • When scaling a document for printing the aspect ratio should be preserved.
  • Do not inset the content with any margins from the Android.Print.PrintAttributes as the application is responsible to render it such that the margins are respected.
  • If document page size is greater than the printed media size the content should be anchored to the upper left corner of the page for left-to-right locales and top right corner for right-to-left locales.
PdfRenderer+PageDocumentation for this section has not yet been entered.
PdfRenderModeEnumerates values returned by several types and taken as a parameter of the Android.Graphics.Pdf.PdfRenderer.Page.Render member.