0

I have an android program which draws lines and text to a canvas. (These are all vector drawing operations.) Does anyone have any advice for exporting that canvas to a PDF? I've looked into changing the Bitmap.CompressFormat that the canvas is based upon, hoping there'd be a PDF (or some sort of vector) format, but no luck there.

My goal is to output some sort of Vector file suitable for printing.

I'd appreciate any advice. Thanks!

Gabe
  • 1,081
  • 2
  • 11
  • 16

2 Answers2

2

There is nothing in Android for this. You can take a shot at seeing if somebody has a PDF library for Java (e.g., iText) working on Android, but these libraries may be large.

A better solution may be for you to save in something simpler (e.g., SVG, an XML format) and have your server convert that to PDF or anything else desired.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

That was very long ago. If anybody happens to find this question nowadays, Android has it since KitKat: PrintedPdfDocument.

Gábor
  • 9,466
  • 3
  • 65
  • 79