Comments (10)
This looks like a fauly PDF file. Any chance to get access to it?
from fpdi.
Any news on this?
from fpdi.
Ok, I will close this issue because of inactivity.
from fpdi.
We found this ticket by searching the web. We are getting similar error (shown below) in our production environment. We are purchased and using FPDI_PDF-Parser-2.0.3.
- Since this issue is already closed, can you reopen this please.
- And we will be able share the PDF file which is causing the issue via a private email. Please let me know how we could share a production/client pdf file with you directly instead of this public portal.
If you need any other details, please let us know. Thanks and your help is very much appreciated.
Here is the error:
2018-09-01 18:35:17 Error: [setasign\Fpdi\PdfParser\Type\PdfTypeException] Stream value expected.
Request URL: /ExpenseReports/generateFinalPdf
Referer URL: https://www.someurl.com/
Stack Trace:
#0 /var/www/html/Enterprise/cakephp/vendor/tcpdf/FPDI_PDF-Parser-2.0.3/vendor/setasign/fpdi/src/PdfParser/Type/PdfStream.php(101): setasign\Fpdi\PdfParser\Type\PdfType::ensureType('setasign\\Fpdi\\P...', Object(setasign\Fpdi\PdfParser\Type\PdfDictionary), 'Stream value ex...')
#1 /var/www/html/Enterprise/cakephp/vendor/tcpdf/FPDI_PDF-Parser-2.0.3/vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReference.php(216): setasign\Fpdi\PdfParser\Type\PdfStream::ensure(Object(setasign\Fpdi\PdfParser\Type\PdfDictionary))
#2 /var/www/html/Enterprise/cakephp/vendor/tcpdf/FPDI_PDF-Parser-2.0.3/src/PdfParser/CrossReference/CrossReference.php(127): setasign\Fpdi\PdfParser\CrossReference\CrossReference->initReaderInstance(Object(setasign\Fpdi\PdfParser\Type\PdfIndirectObject))
#3 /var/www/html/Enterprise/cakephp/vendor/tcpdf/FPDI_PDF-Parser-2.0.3/vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReference.php(188): setasign\FpdiPdfParser\PdfParser\CrossReference\CrossReference->initReaderInstance(Object(setasign\Fpdi\PdfParser\Type\PdfIndirectObject))
#4 /var/www/html/Enterprise/cakephp/vendor/tcpdf/FPDI_PDF-Parser-2.0.3/vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReference.php(64): setasign\Fpdi\PdfParser\CrossReference\CrossReference->readXref(0)
#5 /var/www/html/Enterprise/cakephp/vendor/tcpdf/FPDI_PDF-Parser-2.0.3/src/PdfParser/CrossReference/CrossReference.php(58): setasign\Fpdi\PdfParser\CrossReference\CrossReference->__construct(Object(setasign\FpdiPdfParser\PdfParser\PdfParser), 0)
#6 /var/www/html/Enterprise/cakephp/vendor/tcpdf/FPDI_PDF-Parser-2.0.3/src/PdfParser/PdfParser.php(30): setasign\FpdiPdfParser\PdfParser\CrossReference\CrossReference->__construct(Object(setasign\FpdiPdfParser\PdfParser\PdfParser), 0)
#7 /var/www/html/Enterprise/cakephp/vendor/tcpdf/FPDI_PDF-Parser-2.0.3/vendor/setasign/fpdi/src/PdfParser/PdfParser.php(197): setasign\FpdiPdfParser\PdfParser\PdfParser->getCrossReference()
#8 /var/www/html/Enterprise/cakephp/vendor/tcpdf/FPDI_PDF-Parser-2.0.3/vendor/setasign/fpdi/src/PdfParser/PdfParser.php(179): setasign\Fpdi\PdfParser\PdfParser->getCatalog()
#9 /var/www/html/Enterprise/cakephp/vendor/tcpdf/FPDI_PDF-Parser-2.0.3/vendor/setasign/fpdi/src/PdfReader/PdfReader.php(82): setasign\Fpdi\PdfParser\PdfParser->getPdfVersion()
#10 /var/www/html/Enterprise/cakephp/vendor/tcpdf/FPDI_PDF-Parser-2.0.3/vendor/setasign/fpdi/src/FpdiTrait.php(182): setasign\Fpdi\PdfReader\PdfReader->getPdfVersion()
#11 /var/www/html/Enterprise/cakephp/src/Controller/Component/FileComponent.php(1020): setasign\Fpdi\Fpdi->setSourceFile('/var/www/html/E...')
#12 /var/www/html/Enterprise/cakephp/src/Controller/ExpenseReportsController.php(3572): App\Controller\Component\FileComponent->exportExpenseReportPDFFile(Array, 'AB1342180826161...')
#13 /var/www/html/Enterprise/cakephp/vendor/cakephp/cakephp/src/Controller/Controller.php(441): App\Controller\ExpenseReportsController->generateFinalPdf()
#14 /var/www/html/Enterprise/cakephp/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php(119): Cake\Controller\Controller->invokeAction()
#15 /var/www/html/Enterprise/cakephp/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php(93): Cake\Http\ActionDispatcher->_invoke(Object(App\Controller\ExpenseReportsController))
#16 /var/www/html/Enterprise/cakephp/vendor/cakephp/cakephp/src/Http/BaseApplication.php(103): Cake\Http\ActionDispatcher->dispatch(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#17 /var/www/html/Enterprise/cakephp/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Http\BaseApplication->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#18 /var/www/html/Enterprise/cakephp/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php(107): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#19 /var/www/html/Enterprise/cakephp/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Routing\Middleware\RoutingMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#20 /var/www/html/Enterprise/cakephp/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php(88): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#21 /var/www/html/Enterprise/cakephp/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Routing\Middleware\AssetMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#22 /var/www/html/Enterprise/cakephp/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php(93): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#23 /var/www/html/Enterprise/cakephp/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Error\Middleware\ErrorHandlerMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#24 /var/www/html/Enterprise/cakephp/vendor/cakephp/cakephp/src/Http/Runner.php(51): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#25 /var/www/html/Enterprise/cakephp/vendor/cakephp/cakephp/src/Http/Server.php(81): Cake\Http\Runner->run(Object(Cake\Http\MiddlewareQueue), Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#26 /var/www/html/Enterprise/cakephp/webroot/index.php(37): Cake\Http\Server->run()
#27 {main}
from fpdi.
Please send the PDF in question to [email protected], thanks!
from fpdi.
Appreciate your quick response. I believe we may have found the issue.
- The original file possibly is an paper invoice scanned or taken as a picture in high resolution and saved as PDF. The page size in this document is set to 23.61 x 32.47 in
- It is still a valid PDF document.
- I just reprinted using Acrobat reader into 8.50 x 11.00 in standard letter size and then used it in our process. And that worked.
- Just for your reference, I'm adding a screen shot of the PDF properties page.
What we are trying to do in our process is to combine images and other attachments into a single PDF document. I believe the FPDI-PDF_Parser by default is set to use 8.50 x 11.00 in and not able to handle the large page size file.
Let me know what I'm saying here make sense. If you still need the pdf file, let me know and I'll send it to you.
from fpdi.
Your "solution" has nothing to do with the main problem and FPDI does not set any default page size (but FPDF or TCPSD) nor does not support large files. The initial PDF document simply have an invalid/faulty structure in it. The viewer you are using seems to ignore that problem which allowed you to simply reprint it. Maybe a complete resave would also fix this.
The problem IS the in-file and without analyzing it, it is impossible to see how and if we can fix this.
from fpdi.
Ok, I just sent you the file in question to [email protected] email address.
from fpdi.
Thanks!
The problem with this file is following:
The file includes only a single cross reference but internally it points to a previous one at byte offset 0:
trailer
<< /Prev 0 /Root 5 0 R /Size 6 >>
FPDI finds an object after jumping to this offset but it is simply not a valid cross-reference.
I just fixed this with #58. An official release will follow in the next days or weeks.
from fpdi.
Thank you.
from fpdi.
Related Issues (20)
- Custom Font HOT 3
- Added Text missing except on first page when viewing with some PDF software (incl. Acrobat) HOT 1
- setasign\\FpdiPdfParser\\PdfParser\\PdfPars Class not founded HOT 3
- PDF/A-3 with TCPDF (parameter not transmit)
- How wrap long title HOT 3
- FPDI - Getting "CrossReferenceException::OBJECT_NOT_FOUND" while trying to ImportPage from existing PDF file
- Indirect references in link annotation dictionaries creates corrupted PDFs (when FPDI is used with FPDF)
- Unable to find PDF file header. HOT 2
- while I setSourceFile ,then importPage, the seal missed HOT 1
- Problem with Y Coordinate on different page size HOT 2
- Undefined property: setasign\Fpdi\Tcpdf\Fpdi::$PDFVersion HOT 8
- Set Meta Data HOT 3
- Getting error while adding custom font. HOT 1
- (Question) Replace an Image inside a PDF HOT 1
- Snyk ReDoS vulnerability HOT 1
- WriteHTML() not possible anymore HOT 2
- Don't work without composer autoload HOT 5
- doesn't support cryllic alphabet HOT 3
- Parser have issue here HOT 2
- Undefined TCPDF constant caused by opcache preloading HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fpdi.