Comments (12)
Actually it is even enough to just overwrite the footer method renderFooter
.
from pdfviewhelpers.
Yes, now everything is fine. And it seems like it is a little faster even.
Good job!
Perfekt support!
from pdfviewhelpers.
If you use outputDestination="inline"
then it is only returned inline to the browser, but not saved to the filesystem. If you want to save it to the filesystem you should use outputDestination="file"
or outputDestination="file-inline"
to save it AND return it to the browser.
I tested the different outputDestination
values with the following example and everything seems to work as expected, the document is correctly saved to the filesystem.
https://docs.typo3.org/typo3cms/extensions/pdfviewhelpers/Examples/ExtendExistingPDFs/Index.html
Does this solve your issue? Or else, does it work with the example Extend Existing PDFs
?
from pdfviewhelpers.
No that doesn't change anything. Thx. for the fast reply.
It's not that the file is not generated. The problem is that the content inside of the document is not generated. If I use "file-inline" the document shown is correct but the document saved is without content.
from pdfviewhelpers.
@AureliusHogan Currently I can not reproduce that issue. It seems strange to me, that the document that is returned inline, has different content than the file that is saved, because TCPDF
actually reads the saved file to return it's content. See:
pdfviewhelpers/Resources/Private/PHP/tcpdf/tcpdf.php
Lines 7674 to 7679 in 1647367
and
Does this also happen with the example Extend Existing PDFs
?
Does it work if you do not use the option sourceFile
?
Did this work with v1.x
? If yes, you could try to use an older version of TCPDF (v6.2.17
, https://github.com/tecnickcom/TCPDF/releases)
Can you try to open the document that is saved to the filesystem with your browser?
Are there any errors in the error log?
Can you try to debug that place in TCPDF?
Can you provide your template and maybe corresponding controller action?
from pdfviewhelpers.
Yes, it worked with 1.x!
No errors in log file.
And now the realy strange thing. This is what I see in the browser:
And this is the file which is saved:
test-doc.pdf
And this is the file I get, when I save the inline file:
test-inline.pdf
That's crazy!!
from pdfviewhelpers.
I can view both files:
Maybe there is an issue with your PDF viewer?
Can you try to view the document test-doc.pdf
in the browser? (Probably you can just drag and drop the document to your browser)
Or try to view test-inline.pdf
with the viewer you used for test-doc.pdf
.
from pdfviewhelpers.
Yes, I just now noticed, that Adobe Acrobat says the document has an error. So I tried to validate it as you mention in your documentation. The result is:
Now the question is, how to find the problem? The code I use is rather simple:
<pdf:document sourceFile="typo3conf/ext/pdfviewhelpers/Resources/Public/Examples/ExtendExistingPDFs/pdf_template.pdf" title="ESM PDF-Test" outputDestination="file-inline" outputPath="typo3temp/test.pdf">
<pdf:page autoPageBreak="1" importPage="1" margin="{top: 58, right: 20, bottom: 40, left: 20}">
<pdf:text>
wir freuen uns, dass Sie sich für den folgenden Kurs angemeldet haben:
</pdf:text>
<pdf:text> </pdf:text>
<pdf:headline><f:format.case mode="upper">Innerer Garten</f:format.case></pdf:headline>
<pdf:text><f:format.raw>Hier kannst Du pflanzen was immer Du moechtest. Wichtig ist lediglich der Bezug zur Natur. Nutze die Demeter Gedanken.</f:format.raw></pdf:text>
<pdf:text> </pdf:text>
</pdf:page>
</pdf:document>
from pdfviewhelpers.
There seems to be an issue with the renderHeader
and renderFooter
methods in BasePDF
. You could try to provide your own class and overwrite these methods:
<?php
namespace Vendor\YourExtension\Model;
class MyPDF extends \Bithost\Pdfviewhelpers\Model\BasePDF
{
public function renderHeader()
{
}
public function renderFooter()
{
}
}
plugin.tx_pdfviewhelpers.settings {
config {
class = Vendor\YourExtension\Model\MyPDF
}
}
As long as you do not need the header and footer ViewHelpers, this should work. I will investigate that issue. Thanks again for reporting!
from pdfviewhelpers.
Perfect!!
That does the job for my purposes.
Thanx for the prompt support!!
from pdfviewhelpers.
@AureliusHogan I just released a new version v2.0.1
that should fix that issue. It would be nice if you could update the extension, remove the fix from yesterday and test whether this works for you.
If you like the project, please consider giving it a star :)
from pdfviewhelpers.
Perfect, thanks for reporting and testing!
from pdfviewhelpers.
Related Issues (20)
- Undefined array key warning on PHP 8.0
- Tables unexpected gap HOT 2
- System requirements? HOT 2
- PDF/UA Support HOT 5
- How to get content into pdf? HOT 2
- <style> tag not possible in <pdf:html> HOT 3
- Image viewhelper do not accept FileReference HOT 1
- Autocomplete for Viewhelpers? HOT 6
- Problems with character conversion for languages e.g Polish, Hungarian etc. HOT 10
- PHP 8 errors in AbstractTextViewHelper when text is empty and trim or removeDoubleWhitespace is set to 1 HOT 1
- PHP 8 error in ColumnViewHelper if width isn't set HOT 2
- Shouldn't/couldn't an image (in general and) in the header be embedded in a PDF as a reference - to save memory? HOT 2
- Error in ImageViewHelper with php8.1 HOT 2
- ViewHelper to attach another PDF HOT 1
- TYPO3 12, non-composer: Fpdi not found HOT 2
- Compatibility issues with News Extension version 11.1.1 HOT 3
- Undefined array key error in ImageViewHelper HOT 1
- Support TYPO3 v12.4 LTS HOT 2
- processingInstructions, no File in fileadmin/_processed_ generated HOT 7
- Use in controller HOT 3
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 pdfviewhelpers.