简体   繁体   English

有没有办法旋转在Android中使用PdfDocument画布创建的PDF文件

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

有没有办法旋转在Android中使用PdfDocument画布创建的PDF文件,或者有没有办法在保存到Android上的手机之前旋转pdf文件?

Yes there is a way. 是的,有办法。 Use canvas.rotate(90); 使用canvas.rotate(90); before drawing anything in the canvas of PDF document. 在PDF文档的画布中绘制任何内容之前。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM