答案 0 :(得分:1)
完全有可能!
看看PDFLib Cookbook(学习的最大资源!),更具体地说,是rotate_pages
的示例。
基本上,您可以将页面导入文档并以新的方向放置它。这将根据需要“旋转”页面。
食谱中的PHP示例代码:
/* Loop over all pages of the input document */
for ($pageno = 1; $pageno <= $endpage; $pageno++)
{
$page = $p->open_pdi_page($indoc, $pageno, "");
if ($page == 0)
throw new Exception("Error: " . $p->get_errmsg());
/* Page size may be adjusted by fit_pdi_page() */
$p->begin_page_ext(0, 0, "width=a4.width height=a4.height");
/* Place the imported page on the output page. Adjust the page size
* automatically to the size of the imported page. Orientate the
* page to the west; similarly you can orientate it to the east or
* south, if required.
*/
$p->fit_pdi_page($page, 0, 0, "adjustpage orientate=west");
$p->close_pdi_page($page);
$p->end_page_ext("");
}