html2pdf page number - html2pdf

I've got a html code and when I convert it to pdf using html2pdf, it is longer than a single page, and I need to put the page number in both pages.
I've tried putting the page_footer code as it is said in this post: html2pdf page numbering
but it only shows the page number in the last page, not in the first one. I can modify the html code, but I understand that if I put the tag at the end of it, html2pdf thinks that it refers to the end of the code, not the end of the page.
How can I put the page number in all the pages, from the first one to the last?
thank you!

You can put the attribute footer="page" in the <page> tag and all the pages will be auto-numbered.
<page footer="page">
<page_header>
/* Page Header */
</page_header>
<page_footer>
/* Page Footer */
</page_footer>
/* Page Content */
</page>
html2pdf:en:v4:page

Related

Getting the page title from the new PageTitle

I'm looking for a way to get the page title set via the new PageTitleProvider API to display it inside a FluidTemplate.
In one of our TYPO3 installations, the page title is used as title, displayed on the page itself. The main PAGE object is set up to render a FLUIDTEMPLATE object. I've implemented the examples on the new PageTitleAPI in the documentation, https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/PageTitleApi/Index.html into my extensions and that works just fine for the tag.
However, within the page itself, the title set in the page is still displayed, not the title I've set in my extension.
I've figured out, that I can instantiate the PageTitleProviderManager, but getTitle still resolves to the page name, not the title I've set, most likely because this object is resolved before the PageTitleProviders are set up by the extensions.
$pageTitleProviderManager = GeneralUtility::makeInstance(\TYPO3\CMS\Core\PageTitle\PageTitleProviderManager::class);
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump( $pageTitleProviderManager->getTitle() );
// -> outputs the page name, not the title custom page title
Is there a way to resolve the page title after all Providers are processed and display it in a fluid template?
I also assume it depends on order of execution. so you need to build an order where your plugin is executed before the page title is rendered in the page template.
nowadays most integrators use the f:cObject viewhelper to render the content with lib.content. that means the content (and your plugin is rendered very late), as the page title is probably rendered before any content in the page template (independend whether you use template variables from the page template or a viewhelper which executes PHP or typoscript in the moment of the rendering.
Here you get a hint how to change the order:
try to render the content (including plugins) into a fluid-variable with the page templating ( e.g.:
page.10 = FLUIDTEMPLATE
page.10.variables.content < styles.content.get
) and try to get the page title when the page fluid is rendered: use a viewhelper to get the page title when the initial FLUID variables are already computed.
of course you also can define a FLUID-variable for the content in the page FLUID template before accessing the page title by viewhelper:
<f:variable name="content"><f:cObject typoscriptObejctPath="lib.content" /></f:variable>

How can I pass an object to a specific view on a another page in TYPO3?

I have a simple controller with two actions:
listAction - shows a list of my objects
showAction - shows the detail page of an object
I am using a flexform for my plugin to define the detail page and can access to this via settings array in my controller. The standard view (list view) shows all my objects with a link to the detail page. This link will be generated by this fluid link action:
<f:link.action action="show" arguments="{example: example}" pageUid="{pageId}">details</f:link.action>
The generated links looks as follows:
details
I think that's ok and the redirect to the correct detail page is also working, but it seems that the show view is not showing up, because it will not be rendered. My showAction and my Show.html looks as follows:
Show.html
<f:layout name="Default" />
<f:section name="main">
<h1>Detail page</h1>
<f:debug>{example}</f:debug>
</f:section>
showAction:
/**
* Shows the details page
*
* #param \Fox\Example\Domain\Model\Example $example
* #return void
*/
public function showAction(\Fox\Example\Domain\Model\Example $example) {
$this->view->assign('example', $example);
}
So it seems that the action of the fluid link action viewhelper will be ignored. When I remove the pageUid="{pageId}" from the link action above I can see the show view, but then I will be not redirected to the correct detail page.
What am I doing wrong?
UPDATE
Ok it is working when I include the frontend Plug-In to the detail page, too. Is there a way to pass up the double include?
Ok it is working when I include the frontend Plug-In to the detail page, too. Is there a way to pass up the double include?
No, it is supposed to work like this - a plugin has to be present on a page if it should be rendered there. This presence can be indirect though:
You could reference the plugin (using a record of type "Include Records", or some reference mechanism from an extension).
You could include it using TypoScript (frequently used if it should
be on many pages).
Anyway, if there is no specific reason to have separate pages in the page tree for detail and list view, just put them on one page using the same plugin.

Generic component in CQ5 page

My question is very basic . I am creating a new template and in that template, I will have a concrete structure using DIV elements. But in almost 7-8 if the DIV's, I need the data to be entered by the user.
What component/line of code I can use to have all those 7-8 DIV's editable and customizable by the page creator ?
I tried multiple paragraphs with :
<cq:include path="par" resourceType="foundation/components/parsys"/>
But only the top one appears on the page. !!
For having multiple paragraph just rename the path value in the cq:include tag. also check here

Search the word From PDF in iphone

All
i am working on pdf search function using this link https://github.com/KurtCode/PDFKitten for single page search this code will work correctly but when move to multiple
page search function after scrolling the page it's not pass CGPDFDocumentRef for second page
and page will pass null value for second page
How to search in whole pdf and page list should retrun …???
Thanks in Advance.
Try following sample .
https://github.com/mobfarm/FastPdfKit

Empty body content on TYPO3 page

Encountered an issue today where I made tweaks to the a TYPO3 page and the page became blank. The <body> tag was empty!
I fixed it by clearing cache, but I also found another page with the same problem later on.
Doing some research I found that the page is empty on the cache_pages table.
What is causing it? I am using TYPO3 4.5.6
It happened to me. and the cause was, in the fluid template?
Instead of using fluid template, i just use the regular html tag if you didn't initiate the view helper or something in your form.
This usually happens, if you don't have a PAGE TLO.
Make sure your main template includes something like:
page = PAGE
page {
10 = TEXT
10.value = Hello world!
}
You might have cleared it by accident.