I have a js report pdf with header and footer with dynamic content.But content are overlap on next page.Page break not working on it.
i know this might be old but you can add
<div style="page-break-before: always;"></div>
before any div you want to break the page after
Related
I am using jquery featherlight (https://github.com/noelboss/featherlight) after trying to get jquery lightbox (https://lokeshdhakar.com/projects/lightbox2/) to work. I am using DataTables to generate a list. One of the items in the table is a link to a php page that returns links. The problem is I am calling an external PHP page that generates a list of links. So my link code is like this:
<i class="fas fa-link fa-lg"></i>
The page "lenker.php" does a search and outputs html code. It looks fine in the chrome inspector. But the popup is empty. If I link to another page with the code hardcoded it shows fine. Why does it not show when it is generated on the fly? The html code looks just fine like this:
<div><a class="external" href="http://databank.artsdatabanken.no/FremmedArt2012/N63753" data-featherlight="ajax">fremmedartsvurdering 2012 for edelgran</a></div>
<div><a class="external" href="http://eol.org/pages/1033070" data-featherlight="ajax">edelgran hos Encyclopedia of Life</a></div>
<div><a class="external" href="http://linnaeus.nrm.se/flora/barr/pina/abies/abiealb.html" data-featherlight="ajax">edelgran i Virtuella floran, Sverige</a></div>
but the popup opens and then resizes to almost nothing since there is no content. Featherlight does not need any other initialization since it looks for data-featherlight="ajax".
Is the problem that datatable is dynamic content?
jQuery ajax expects one object so I solved this with enclosing my content in one DIV.
I generate html documents that contain a menu and a content part. Then I want to extract the content of these document to feed it to a lucene index. However, I would like to exclude the menu from the content extraction and thus only index the content.
<div class="menu">my menu goes here</div>
<div class="content">my content goes here</div>
what is the simplest way to achieve this with apache tika?
As a more general solution (not just for you specific menu) I would advise looking at boilerpipe that deals with removing uninteresting parts from pages (menus, navigation etc).
I know it can be integrated in Solr/tika, have a look and you probably can integrate it in your scenario.
Have a look at this post which specifies how to handle DIVs during the HTML parse, by specifying whether they are safe to parse or not, in which case its ignored. For your problem, you could have some logic in the override methods which ignore only DIV elements with attribute value "menu" (i.e. tell TIKA parser this DIV is unsafe to parse).
You can parse the html with a parser to a xhtml dom object an remove the div tag cotaining the attribute class="menu".
I have a dynamically generated page made up of some divs and tables and other elements inside those divs, all absolutely positioned. The lower divs can potentially have more contents in them, like comments/description, so they'll be longer then a page.
The problem is dompdf doesn't insert a page break, it just spans till end of first page and the rest of my html gets cut off...
Obviously page-break-before/after allways is not going to work since the content is dynamic, it may or may not span multiple pages depending on every entry.
Does anyone know of a simpler way to make it behave, apart from measuring content height, inserting page breaks with JS before html is generated and sent over to dompdf?
The issue was a large div containing all elements with in the body. Dompdf is not able to comprehend div to break into pieces. Once that was gone it arranged separate elements within the body tag just fine.
The reason is that dompdf doesn't insert an auto page break in elements with position:absolute. Here's the bug report: Auto page break in "position:absolute" elements not working
So without knowing the details of your CSS, I would say that the problem is not about "breaking the div into pieces" but about treating absolute as literally absolute on this very page.
I have a container layout of a webpage that works like this:
<html>
#header#
<div class="content_container"> #content inserted here# </div>
#footer#
</html>
If the content has a div that is not closed or closes a div without it being opened, the content_container's div and so the layout gets messed up.
How is this situation normally avoided or solved?
Hy,
From what i found on the net, you could parse the fragment as a HTML document using the DOM loadHTML function, then spit it back out again as HTML. That will fix any HTML well-formedness errors.
Or you could use the Tidy extension for php5
http://www.php.net/tidy
Quite simple really.
I have two ContentPanes that I load content into dynamically. The content I load dynamically contains TitlePanes. When I collapse these TitlePanes the content below the TitlePane does not shift up.
(you may ask why I don't load the content into ContentPanes INSIDE the TitlePanes. The reason I don't do that is because the TitlePanes won't expand to cover the dynamic content)
The answer for this can be found here. All you need to do apperently is add doLayout="false
<div dojoType="dijit.layout.ContentPane" id="..." splitter="false" doLayout="false"></div>