PDF_open_file

(PHP 4 >= 4.0.5, PECL pdflib >= 1.0.0)

PDF_open_fileCreează un fișier PDF [învechit]

Descrierea

bool PDF_open_file ( resource $p , string $filename )

Creează un fișier nou PDF utilizând numele fișierului furnizat. Întoarce valoarea TRUE în cazul succesului sau FALSE în cazul eșecului.

Această funcție este învechită începând cu PDFlib versiunea 6, utilizați PDF_begin_document() în loc.

add a note add a note

User Contributed Notes 11 notes

up
0
gbl at bso2001 dot com
15 years ago
Appending to PDF files: plainly, you can't. PDF files have an internal structure that would get corrupted by just appending to the file. You'd need to parse the PDF, create a new PDF and mix your additions with the old PDF. Just creating a new one should be *much* easier.

Reading back the results: do a fopen() on the temporary file and use fgets() to read it. In your example where you just want to output the file, passthru should do the trick.
up
-1
Anonymous
12 years ago
"Fatal error: PDFlib error: [2100] PDF_begin_page: Function must not be called in 'object' scope.."

If you get this error then you probably forgot to call pdf_open_file() or pdf_open_file() failed.
up
-1
php at mijav dot dk
12 years ago
The example uses pdf_set_font, but that function is deprecated. Instead use pdf_setfont (without the underscore).
up
-1
Anonymous
13 years ago
After some troubles I found filename must be absolute path  here in windows; relative path doesn't work in my box.
php 4.3.5-dev
up
-2
RandyAtHorktDotCom
15 years ago
It is possible to append pdfs to each other, however it requires the commercial version of PDFlib with PDI support (http://www.pdflib.com)

I've used it quite a bit and is well worth the price they are asking for.
up
-2
jon at logicworks dot cc
15 years ago
When
(Ph.3pdf-o/h3>
g pss="ot toseemref=hpport
phpw"de:>
;de> or then yos$tes <8.5*72,"ph*72);de>s$tes <"Helve Out-Bold", 24 <"host");de> ph=foo.tes");de> < id="V19199" title="50% like this..."> 0
13176atrong cla3s="user">jon at logicworks dot cc< 13176at="genanchor" href="#26274"> ¶13 years ago<113176amp
4pan class="html"> Appending to PDF files: plainly, you 13176am id="allnotes">
5690a6274"> jon at logicworks dot cc< 5690a6="genanchor" href="#26274"> ¶15 years ago<15690amp
The example uses pdf_set_font, but th5690am _page: Function must not be called in 'object' scope.."

If you get this error then you probably forgot to call pdf_open_file() or pdopen_file() famy box.a <-pan n>
"C:\web\tes\3pst45.tes"iv> iv> "ystes-> "iv> "host"iv> iv> "et_fress="fs-"iv> "Aer. clas *muchd!"iv> e>
"C:\\web\\tes\\3pst45.tes"iv> iv> "ystes-> "iv> "host"iv> iv> "et_fress="fs-"iv> "Aer. clas *muchd!"iv> e> waonotenoF.dex" ale="rhru sh PDFvdfVd517swaofpara">fullys *muchdpen_file() famthediaed.DFvo4466( add 2'sed.pid=)pen_file() fGlenn
<824&a1793"> jon at lo5>15 years ago<6824&
"Fatal error: PDFlib error: [2100] Pe824&am _page: Function must not be called in 'object' m>jde> /lMode.tes", "w");de>s$tes"he, "Helve Out", 20 <"host", 1);de>jde>jde> /lMode.tes", "w");de>
/lMode.tes");de>s$tes"he, "Helve Out", "wirs si", 0);de>s$tes"he, $pan> <20);de>jd
74697arong class="user">RandyAtHo3>~O~T "2002-02-19 11:30">15 years ago<74697amp
<0pan class="html"> "Fatal error: PDFlib error: [2100] P74697am _page: Function must not be called in 'object' FYI:e whereasov>
I've ca3 a note' width='ables noteutpu
ph, masersu/div> r indows ww haofwri i ?bugi
< old PDF@2x.pnory />Readate rythe oldsd to/>Rea. You'd oljd
add a note add a note

User Contributed Notes 11 notes

d e.php?s>ipt> ction="/manual clasever it'ction="
'as'divual-i> lMod'as 'child-i> lMod'as Gcom-iase Secro/functioerr​d" >Gcomr​iase
Gcomr​iaseage=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​dddr​on=on.pp
add a o/functioerr​dttachr​>
tion o/functioerr​or the​pan>dioerr​or the​pan>ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls
Sessro/functioerr​or the​lay'>
ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls
ro/functioerr​or the​od="e​/a> oerr​or the​od="e​/a>ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls
ro/functioerr​or the​od=" oerr​or the​od="ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls
ro/functioerr​or the​e fi oerr​or the​e fi ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls
ro/functioerr​or the​e fi < oerr​or the​e fi add a o/functioerr​circ>a oerr​circ>aive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls M o/functioerr​closee​imd=" oerr​closee​imd="ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​closee​pdie​od=" oerr​closee​pdie​od="ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​closee​pdi oerr​closee​pdiive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​close oerr​closeive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls l-tml"ke
  • ro/functioerr​closev clr​> lr​tml"ke oerr​closev clr​> lr​tml"keive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​closev clr​tml"ke oerr​closev clr​tml"keive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​closev cl oerr​closev clive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​conca oerr​conca ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​continuer​t pl oerr​continuer​t plive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​c*muchr​gst <
    ro/functioerr​c*muchr​pvf
    Sessro/functioerr​definee​lay'>
    ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​delechr​pvf
    ro/functioerr​delechr​t Ser
    Sessro/functioerr​encour er​tet ​cha>p
    ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls
    tion o/functioerr​rt e​pan>dioerr​rt e​pan>ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls Sessro/functioerr​rt e​lay'>
    ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​rt e​od="e​/a> oerr​rt e​od="e​/a>ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​rt e​od=" oerr​rt e​od="ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​rt e​e fi < oerr​rt e​e fi ro/functioerr​endv cl oerr​rt v clive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls l-imd="blockd> lr​imd="block oerr​> lr​imd="blockive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls l-/diblockd> lr​/diblock oerr​> lr​/diblockive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls l-tml"ke
  • ro/functioerr​> lr​tml"ke oerr​> lr​tml"keive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls l-t plblockd> lr​t plblock oerr​> lr​t plblockive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ld> l oerr​> live=functiollllllllllllllllll/earch" id=lllllllllllllllllllls d> ndpan> oerr​> ndpan>ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls M o/functioerr​lltr​imd=" oerr​> tr​imd="ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​> tr​pdie​od=" oerr​> tr​pdie​od="ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​> tr​t Ser
    tr​t Serive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls tr​t plflowp
    tr​t plflowive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​> tr​t plon.pp
    tr​t plon.pive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​get ​api PECp
    ro/functioerr​get ​busferp
    ro/functioerr​get ​errmsgp
    d> oerr​get ​pan>ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls PEChp'>ro/functioerr​get ​pan> PEC oerr​get ​pan> PECive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls sizChp'>ro/functioerr​get ​pan>sizC oerr​get ​pan>sizCive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​get ​imd=" ​s ro/functioerr​get ​imd=" ​ibute oerr​get ​imd=" ​ibuteive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​get ​major_blank" oerr​get ​major_blank"ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​get ​minor_blank" oerr​get ​minor_blank"ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​get ​div meter oerr​get ​div meterive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​get ​ddie​odv meter oerr​get ​ddie​odv meterive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls hp'>ro/functioerr​get ​ddie​orm> oerr​get ​ddie​orm> ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls hp'>ro/functioerr​get ​orm> oerr​get ​orm> ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls d> oerr​fnam ​pan>ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​fnam ​t Ser
    ro/functioerr​fnam ​t plon.pp
    ro/functioerr​fnitgraphicsp
    d> oerr​ooadr​pan>ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls add a o/functioerr​ooadr​iccproll>a oerr​ooadr​iccproll>aive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls M o/functioerr​ooadr​imd=" oerr​ooadr​imd="ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls ro/functioerr​masespotcolor oerr​masespotcolorive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls
    d> oerr​
    ive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls
    add a o/functioerr​
    a oerr​
    aive=functiollllllllllllllllll/earch" id=lllllllllllllllllllls
    ro/functioerr​