PrintedPdfDocument 中 Canvas.drawText() 的替代方法
Alternative for Canvas.drawText() in PrintedPdfDocument
我已经通过这个 link 创建了一个包含文本的 sample.pdf
文件。
但是因为这个 API 提供了仅使用 Canvas
class 来编写文本的方法。所以我无法从生成的 sample.pdf
文件(因为它被视为图像)中 select 文本(我们通常可以在其他 PDF 文件中这样做) .此外,该文本在最大缩放时得到 像素化 (因为当然那些是字母的 图像 而不是 类似矢量的文本 ).
So my question: Is there any way through which I can just write text
in PDF without Canvas
in PrintedPdfDocument
?
欢迎您生成一些 HTML,然后 print it using a WebView
。
或者,欢迎您使用任意数量的 PDF 生成库。 This category in the Android Arsenal 列出了一些,以及 PDF 查看器和其他与 PDF 相关的实用程序。
我已经通过这个 link 创建了一个包含文本的 sample.pdf
文件。
但是因为这个 API 提供了仅使用 Canvas
class 来编写文本的方法。所以我无法从生成的 sample.pdf
文件(因为它被视为图像)中 select 文本(我们通常可以在其他 PDF 文件中这样做) .此外,该文本在最大缩放时得到 像素化 (因为当然那些是字母的 图像 而不是 类似矢量的文本 ).
So my question: Is there any way through which I can just write text in PDF without
Canvas
inPrintedPdfDocument
?
欢迎您生成一些 HTML,然后 print it using a WebView
。
或者,欢迎您使用任意数量的 PDF 生成库。 This category in the Android Arsenal 列出了一些,以及 PDF 查看器和其他与 PDF 相关的实用程序。