zendframework / zendpdf Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
It sees that ZendPdf depends on the MemoryManager but that dependecy is not in Composer.
Fatal error: Class 'Zend\Memory\MemoryManager' not found in /vendor/zendframework/zendpdf/library/ZendPdf/PdfDocument.php
Hello,
When I try to input Bulgarian Cyrillic characters via drawText(), I get this error:
Notice: iconv(): Detected an illegal character in input string in .../vendor/zendframework/zendpdf/library/ZendPdf/Resource/Font/Simple/AbstractSimple.php on line 253
Here's a sample
$page1->setFont($font, $headerSize)->drawText('Основна', 0, 800);
Tried to play with some other options, but no luck. Any chance for fix or advice? Thank you.
Hi,
When the function StreamObject::_extractDictionaryData is called an excpetion is handle Undefined property: \ZendPdf\InternalType\ArrayObject::$value
This bug comes to try get a value on an array ( line 114 ).
$paramKey = HSample;
$this->_dictionary->DecodeParms->$paramKey->value
So here the code is wrong because it trying to get ->value property on an array.
Regards,
Boris.
Dump of the real pdf structure
$this(ZendPdf\InternalType\StreamObject)
|-[-] _dictionary(ZendPdf\InternalType\DictionaryObject)
| |-[-] _items[12]
| | |-[+] BitsPerComponent(ZendPdf\InternalType\NumericObject)
| | |-[+] ColorSpace(ZendPdf\InternalType\NameObject)
| | |-[-] DecodeParms(ZendPdf\InternalType\DictionaryObject)
| | | |-[-] _items[8]
| | | | |-[+] Blend(ZendPdf\InternalType\NumericObject)
| | | | |-[+] ColorTransform(ZendPdf\InternalType\NumericObject)
| | | | |-[+] Colors(ZendPdf\InternalType\NumericObject)
| | | | |-[+] Columns(ZendPdf\InternalType\NumericObject)
| | | | |-[-] HSamples(ZendPdf\InternalType\ArrayObject)
| | | | | |-[+] items(ArrayObject)
| | | | | `- *ZendPdf\InternalType\AbstractTypeObject*_parentObject null
Current releases of the library are advocating compatibility with all future versions of zendframework/zend-stdlib
(which may be broken already, as version 3 contained a bunch of BC breaks) and of zendframework/zend-memory
.
Bound constraints should be used instead
use \ZendPdf\Style as Style;
class MyStyleText extends Style
{
public function __construct()
{
$this->setFillColor(new \ZendPdf\Color\Rgb(192, 192, 192));
$sPath = getcwd()."/data/fonts/arial.ttf";
$this->setFont(\ZendPdf\Font::fontWithPath($sPath), 20);
}
}
Reports the error:
Catchable fatal error: Argument 1 passed to ZendPdf\Style::setFillColor() must be an instance of ZendPdf\Color, instance of ZendPdf\Color\Rgb given, called in C:\wamp\www\zf2b5\ZendSkeletonApplication\module\Luach\src\luach\Model\styles\MyStyleText.php on line 13 and defined in C:\wamp\www\zf2b5\ZendSkeletonApplication\vendor\zendframework\ZendPdf\library\ZendPdf\Style.php on line 103
README says look in the documentation folder, there isn't one
Are multiline text fields in PDF form fields supported?
That means can I e.g. pass to setTextField() any special character to create a line break?
2.0.1 has a rather breaking bug that was fixed 5 months ago (214e2d1).
I'm guessing there have been some other improvements in that time that you might want to include, too.
Please provide documentations: How to install, usage, etc.
in my controller,
use Zendpdf\pdfdocument,
public function monthlyReportPdfAction()
{
$pdf = new PdfDocument();
$pdf->pages[0] = new Page( Page::SIZE_A4 );
$pdf->pages[0]->setFont( Font::fontWithName( Font::FONT_HELVETICA ), 24 );
$pdf->pages[0]->drawText( 'Hello world!', 240, 400 );
$pdf->save( 'example.pdf' );
}
Hi,
I can't find any documentaion on how to use ZendPDF.
There are nothin on http://framework.zend.com/ and in README.md is a note:
At that point, follow the instructions in the documentation folder for actual usage of the component. (Documentation is forthcoming.)
but no documentation folder found.
Is there anything anywhere?
Since there is no newer release than 2.0.2, I'm not able to
require ~2.0.2 via composer. It loads a 4 years old commit.
Hi,
First of all, thanks for working on this new version of ZendPdf. I'm currently using ZendPdf to manipulate pdf's metadatas and it's perfectly working with all documents until version 1.4.
However, as PDF versions 1.5 (Acrobat 6) and version 1.7 (Acrobat 7) aren't yet supported, I can't change metadatas on documents generated with these versions.
As google unfortunately only suggested me commercial tools to deal with that task (such as SetaPDF), I was wondering if there was a roadmap to implement Acrobat 6 and Acrobat 7 support in ZendPdf or if you knew any Open Source Php Class including this feature ?
Thanks for your help !
Minor spelling error found:
RecursivelyIteratableObjectsContainer (incorrect)
RecursivelyIterableObjectsContainer (correct)
Condition in ZendPdf\Page on line 825 can throw fatal error in cases where
BaseFont is not an object.
if ($fontDictionary->BaseFont->value != $fontName) {
continue;
}
I got en error when converting ps file to pdf and then tried to get fonts from it.
hi there,
what do you think of being able to create a ZendPdf/Image from a base64 string instead of from a file ? Anyone has done it before ?
thanks
Not sure if I do not understand the code correctly, or the error message was not updated accordingly, but this code is somehow misleading:
From what I see it checks for PDF versions greater then 0.9 and smaller then 1.6.1. The exception tells that only 1.4 is supported.
I just realized this because I wanted to open a PDF document with version 1.6 and it does not seem to be supported.
Hi,
I encounter very serious performance trouble with this file : https://github.com/zendframework/ZendPdf/blob/master/library/ZendPdf/Resource/Image/Png.php#L233
case self::PNG_CHANNEL_RGB_ALPHA:
/*
* To decode PNG's with alpha data we must create two images from one. One image will contain the RGB data
* the other will contain the Gray transparency overlay data. The former will become the object data and the latter
* will become the Shadow Mask (SMask).
*/
[…]
//Iterate every pixel and copy out rgb data and alpha channel (this will be slow)
for($pixel = 0, $pixelcount = ($width * $height); $pixel < $pixelcount; $pixel++) {
$imageDataTmp .= $pngDataRawDecoded[($pixel*4)+0] . $pngDataRawDecoded[($pixel*4)+1] . $pngDataRawDecoded[($pixel*4)+2];
$smaskData .= $pngDataRawDecoded[($pixel*4)+3];
}
I found two mentions on the great internet:
In the first article there is a mention of parsers being recoded. 6 years later and no trace of that change. Is there any plan on this bug?
See ya. Thanks.
When we try loading pdf file size more than 5 MB there is problem.
PdfDocument runs _loadOutlines with PDF trailer root.
Then in the _loadOutlines function it trys to getType from OutLines - $root->Outlines->getType()
Then there is $this->_ref which is null and it runs $this->_dereference();
Problem in this method _dereference()
There are 3 conditions in this method:
The problem that in my case when file size more than 5 MB.
After first condition obj is set new InternalType\NullObject();
Second condition is skipped because obj is not null
In the third condition it uses method toString() and it returns null and this condition returns exception "Incorrect reference to the object" .
In my opinion it returns this exception because PdfParser\StructureParser sets wrong context. It doesn't set RefTable to the context and then $offset is null inside getObject and it returns NullObject.
Please check loading pdf file with size more than 5 MB.
I have some problems with characters like '€' in PDF form fields. It is shown in the PDF as a circle if I use setTextField().
However the same text is displayed correctly, if I use drawText().
Hi,
I'm not sure if this repo is now mothballed... however I'm trying to work out if ZendPDF can draw bezier curves. The code alludes to the fact that it uses them, but I cannot find any methods which draw them.
Any help would be really appreciated!
Thanks
Ben
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.