有什么方法可以旋转在 android 中使用 PdfDocument canvas 创建的 PDF 文件

Is there any way to rotate a PDF file created using PdfDocument canvas in android

有什么方法可以旋转 android 中使用 PdfDocument canvas 创建的 PDF 文件,或者有什么方法可以在 android 上保存到 phone 之前旋转 pdf 文件=] ?

是的,有办法。在 PDF 文档的 canvas 中绘制任何内容之前使用 canvas.rotate(90);

canvas.save();
// rotate with respect to center of the page.
canvas.rotate(90, canvas.getWidth() / 2, canvas.getHeight() / 2);
canvas.draw(/*whatever*/);
canvas.restore();