略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: PDF_begin_document

2024-11-15

PDF_begin_document

(PECL pdflib >= 2.0.0)

PDF_begin_documentCreate new PDF file

说明

PDF_begin_document ( resource $pdfdoc , string $filename , string $optlist ) : int

Creates a new PDF file subject to various options.

add a note add a note

User Contributed Notes 4 notes

up
1
jk at buero-ix dot de
1 year ago
PDFlib is not under GNU GPL and has therefore to be bought, if you want it to use.
up
0
walterdolce at gmail dot com
6 years ago
If you want a complete documentation on the entire PDFlib is it possible to download, read and study the reference .pdf file (and related) on [ http://www.pdflib.com/fileadmin/pdflib/pdf/manuals/PDFlib-7-API-reference.pdf ]

Note that this link points to a precise version of the library. You may want to check newer versions in the future on the same domain.
up
-9
wheatin at gmail dot com
11 years ago
There doesn't seem to be much documentation on setting options with this function, but here's the format for setting some basic things:

$optlist = "destination={page=1 type=fixed zoom=1 top=100 left=50}";
PDF_begin_document($pdfdoc, $filename, $optlist );

the '=' character can be replaced with a space, but I think '=' makes the code more readable.
Also, you must include 'type=fixed' to use 'zoom','left', or 'top'. You can set 'page' without it, though.
Hope this helps. And if anybody knows a good reference for the options that can be set here and what the format is, please link.
up
-17
daniel at objective-view dot de
11 years ago
Creating a PDF with a defined PDF-Version (1.6 in this case) works like this:

if (PDF_begin_document($p,  "", "compatibility 1.6") == 0) {
    die("Error: " . PDF_get_errmsg($p));
}

官方地址:https://www.php.net/manual/en/function.pdf-begin-document.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3