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,041
  • 2
  • 10
  • 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
  • 954,112
  • 185
  • 2,315
  • 2,367
0

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

Gábor
  • 8,504
  • 2
  • 54
  • 72