【发布时间】:2020-09-23 11:04:34
【问题描述】:
【问题讨论】:
标签: pdflib
【问题讨论】:
标签: pdflib
完全有可能!
查看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("");
}
【讨论】: