|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-13 04:23 UTC] tony2001 at phpclub dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 03:00:01 2025 UTC |
Description: ------------ The save() method does not generate any file when I specify a relative file path. Windows XP SP2 PHP 5.2.3 Reproduce code: --------------- <?php $doc = new HaruDoc(); $doc->setPageMode(HaruDoc::PAGE_MODE_USE_THUMBS); /* show thumbnails */ $page = $doc->addPage(); /* add page to the document */ $page->setSize(HaruPage::SIZE_A4, HaruPage::LANDSCAPE); /* set the page to use A4 landscape format */ $courier = $doc->getFont("Courier-Bold"); /* we'll use the bundled font a few lines below */ $page->setRGBStroke(0, 0, 0); /* set colors */ $page->setRGBFill(0.7, 0.8, 0.9); $page->rectangle(150, 150, 550, 250); /* draw a rectangle */ $page->fillStroke(); /* fill and stroke it */ $page->setDash(array(3, 3), 0); /* set dash style for lines at this page */ $page->setFontAndSize($courier, 60); /* set font and size */ $page->setRGBStroke(0.5, 0.5, 0.1); /* set line color */ $page->setRGBFill(1, 1, 1); /* set filling color */ $page->setTextRenderingMode(HaruPage::FILL_THEN_STROKE); /* fill and stroke text */ /* print the text */ $page->beginText(); $page->textOut(210, 270, "Hello World!"); $page->endText(); $doc->save("./test.pdf"); /* save the document into a file */ ?> Expected result: ---------------- test.pdf should be generated in the same directory with the PHP code file. Actual result: -------------- No file is generated. No error occurs. PDF is generated when I make a change as follows: $doc->save(dirname(__FILE__)."/test.pdf");