I am generating a PDF Document through XSL-FO. I have a simple xhtml structure like this:
<body>
<h2><center>Status</center></h2>
<table border="0">
<colgroup span="5"></colgroup>
<tr>
<td><h4>Aktion</h4></td>
<td><h4>Kommentar</h4></td>
<td><h4></h4></td>
<td><h4>Zeitpunkt</h4></td>
<td><h4>Benutzer</h4></td>
</tr>
<tr>
<td><h5>Mappe archiviert</h5></td>
<td><h5>QMSAA</h5></td>
<td><h5></h5></td>
<td><h5>26.07.2011 13:14</h5></td>
<td><h5>Mustermann, Peter</h5></td>
</tr>
<tr>
<td><h5>Mappe als pdf gedruckt.</h5></td>
<td><h5></h5></td>
<td><h5></h5></td>
<td><h5>26.07.2011 13:14</h5></td>
<td><h5>Mustermann, Peter</h5></td>
</tr>
....
And i am using a xhtml to fop Stylesheet to convert this xhtml to an xsl-fo table. This works for most cases and in this case here i also get one page of content, but this should be at least two pages. While generating i get the following warnings:
30.08.2011 09:57:36 org.apache.fop.apps.FopFactoryConfigurator configure
INFO: Default page-height set to: 11in
30.08.2011 09:57:36 org.apache.fop.apps.FopFactoryConfigurator configure
INFO: Default page-width set to: 8.26in
30.08.2011 09:57:36 org.apache.fop.fo.flow.TableColumn bind
WARNUNG: table-layout="fixed" and column-width unspecified => falling back to pr
oportional-column-width(1)
30.08.2011 09:57:37 org.apache.fop.layoutmgr.inline.ContentLayoutManager
WARNUNG: Title has no content
30.08.2011 09:57:37 org.apache.fop.layoutmgr.PageBreaker$1 notifyOverflow
WARNUNG: Content of the region-body on page 1 overflows the available area in bl
ock-progression dimension. (fo:page-sequence, no context info available)
The result i get is one page of content with one element overflowing the bottom of the page. But the rest of the content is lost, not second page is generated.
What could be the problem here?
Is it possible to have a pagebreak between two fo:table-row elements of one table?
Why is no second page generated?
There is a problem with the keep-with-next.within-column property on blocks within table cells in your FO document. If the "always" values are replaced with "auto", FOP 1.0 outputs four pages.
This could be a bug in FOP. I also processed the FO document with XEP, and it produced four pages without complaining.
Maybe what you really want is keep-together on table rows?
I also noticed an empty font-family attribute on <fo:page-sequence>.
Not really an answer to your question, but you could use the open source speedata Publisher which has automatic table breaking across pages. It is not an XSL-FO formatter but similar. Currently in German only (this will change in spring 2012) but I know that this is not a problem for you.
Related
I am getting the exact same error code as this question. I also read the answer to that post but not sure how it'll help in the context of this specific error.
NReco PDF generator works when I omit this line in this html file:
<tr>
<td valign="bottom"><div align="left" class="P ">- Other Receipts</div></td>
<td valign="bottom"><div align="center" class="P ">(36)</div></td>
<td valign="bottom"><div align="right" class="P ">83,00</div></td>
</tr>
If I do include that line I get the (exit code: -1073741819) exception. If I really want to include that line, then I must omit this line of code at the header of the same html file:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
For me this is beyond irrational behavior. I dont see how styling or the content that I add in the html file will cause it to crash.
Can anyone assist me with this?
NReco.PdfGenerator is a .NET wrapper for wkhtmltopdf, and this kind of exception indicates that 'wkhtmltopdf.exe' process is crushed for unknown reason.
This means that you need to check what in wkhtmltopdf causes a crush -- you may do that in the command line, actually. Typical reasons:
CSS border-radius rules in some specific cases may cause a crush
if page margins are defined explicitly and it is not enough space for header or footer content this also may cause wkhtmltopdf crush
Unfortunately only way to find a workaround are experiments, however in most cases workaround is possible.
I am converting a document that is readonly into a one where a user can edit.
Looping the values into a text was possible, my problem is converting those text into fields.
Currently I have the following code in my HTML, whereby the defectDto is the object I am planning on using to capture the fields.
<tr th:each="res, stat : *{response}" th:object="${defectDto}">
<td>
<input type="number" th:field="*{res[__${stat.index}__].defectId}" readonly="true"/>
</td>
...
</tr>
The HTML code above results in a processing error, please see image below:
In Java, I've used the model to bind the list returned (as seen below):
model.addAttribute("response", getDefectMessage.getMessage());
getDefectMessage.getMessage() above is of type List of DefectDto. The sample data is as seen below (please see image).
Being a newbie in Thymeleaf, may I please get assistance in rendering the HTML page without any errors. (Thanks in advance).
Unfortunately there's no details/summary element in the default CKEditor configuration of TYPO3 and I'm looking for a way to add it.
What I've been trying to do:
I searched and found a widget on https://ckeditor.com/cke4/addon/detail , but it's repository on GitHub has been archived and the widget does not work as expected. It requires 'api,widget' and this generates a JavaScript error:
[CKEDITOR.resourceManager.load] Resource name "api" was not found at "/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/api/plugin.js?t=K24B-4e13cc129f".
When removing this requirement for "api", there's an error regarding line 72
CKEDITOR.api.parser.add(item, el);.
Then I found a similar widget at GitHub , which looks like an older version of the former without requirement for "api".
It already looks quite good, but is still a bit buggy: the HTML structure is changed when saving and the summary is duplicated. When switching to the source code, the HTML structure specified in the template ...
<details><summary>Summary</summary><div class="details-content"></div></details>
… get's partially lost.
I'm not sure if the widgets are buggy or if the editor is limited by the integration into TYPO3 and I was also not able to combine the two in a way that would lead to a working solution.
Update (Jul 22):
I successfully modified the Creating a Simple CKEditor Widget (Part 1) example to create
a widget with the following HTML structure:
<div class="expander">
<p class="expander-title">Title</p>
<div class="expander-content"><p>Content...</p></div>
</div>
With the help of a small JavaScript snippet and some CSS it now behaves almost like a details-summary element, but is not quite as good in terms of SEO and accessibility.
If I replace the elements <div class="expander"> and <p class="expander-title"> with <details> and <summary> in the widget, it unfortunately doesn't work properly anymore and changes the structure when saving. For some reason the RTE treats them differently.
I have already manually added the following to the RTE configuration:
processing:
allowTags:
- details
- summary
allowTagsOutside:
- details
- summary
Using SSRS in Visual Studio 2012 I currently have the following expression in the report header.
=ReportItems!FirmName.Value
This correctly pulls the Firm name such as Client1, Client2, Client3 etc... from the body of the report.
However if ReportItems!FirmID = 600, I need the Font size of the first character in Firm name to be larger then the other characters.
This is because a particular client has a logo where the first character is larger than the others.
I tried the following expression which I know is wrong but might illustrate what I'm trying to do.
=IIF(ReportItems!FirmID.Value = 600,LEFT(ReportItems!FirmName.Value,1), "18pt", ReportItems!FirmName.Value))
So say client3 has FirmID 600 the result should be like this, you may need to run the code snippet to see what I mean...
<html>
<body lang=EN-US style='tab-interval:.5in'>
<div class=WordSection1>
<p class=MsoNormalCxSpFirst>Client1<o:p></o:p></p>
<p class=MsoNormalCxSpMiddle>Client2<o:p></o:p></p>
<p class=MsoNormalCxSpLast><span style='font-size:20.0pt;line-height:115%'>C</span>lient3</p>
</div>
</body>
</html>
I tried Ian's suggestion
which I thought was working, but I cannot yet get it to work. I can get this to work in the report body, but there are additional complications. The font size change needs to be in the Report Header, which requires referencing the report body via ReportItems! You cannot reference more than one ReportItems! in the report header or you get an error like the following
The Value Expression for the textrun Textbox12 refers to more than one report item. An expression in a page header or footer can refer to only one report item.
Yet there is one more problem and I should have clarified this in my original entry. The actual client name is like this.
Client & Associates
Both of the first letters need to be larger, but not the ampersand between them.
<html>
<body lang=EN-US style='tab-interval:.5in'>
<div class=WordSection1>
<p class=MsoNormal><span style='font-size:22.0pt;line-height:115%'>C</span>lient
& <span style='font-size:18.0pt;line-height:115%'>A</span>ssociates</p>
</div>
</body>
</html>
You can do this by creating a couple of text placeholders within the same textbox, splitting the text between these and apply a font-size expression to the first placeholder only.
See Formatting Text and Placeholders for a good overview.
In a simple example with your data:
I have a simple table to display this:
Note there are two <<Expr>> values in the last column - I have added another placeholder in this textbox.
I have split FirmName between these placeholders; in the first:
=Left(Fields!FirmName.Value, 1)
and in the second:
=Right(Fields!FirmName.Value, Len(Fields!FirmName.Value) - 1)
Even though the text is split in two expressions, it looks fine when the report is run:
Since each placeholder can have its own formatting, we can apply an expression like the following to FontSize on the first placeholder only:
=IIf(Fields!FirmID.Value = 600, "15pt", "10pt")
i.e. increase font size of the first letter for firm 600, which gives us the required results:
I am having a problem where I try to render a <table> inside of parent container, but MVC3 Razor always renders the outside of the container tag. This causes problems when trying to control the outside parent container via Javascript.
Razor Example:
<span id="mySpan">
#Html.Action("Table1", "GetMyTable")
</span>
HTML that is output:
<span id="mySpan"></span>
<table>
<thead><tr><th>Header</th></tr></thead>
<tbody>
<tr><td>Foo</td></tr>
<tr><td>Bar</td></tr>
</tbody>
</table>
No matter which parent container I try to stick the table into, a div, span, p, the table always renders OUTSIDE the container's tags! Can anyone explain what I am doing wrong? How should I code the Razor syntax to properly add the table inside those tags?
as you are viewing the output in Firebug, what is happening is you are seeing an "effective" view of the html, after the browser engine has parsed it.
in HTML5, many tags do not need to be explicitly closed. If you include a tag "inside" another that is invalid (like a table inside a span), the browser assumes what you are doing is using an unclosed span tag, so it automatically closes it for you before starting the table tag.
The easiest fix here would be either not to "wrap" the table, or wrap it with something that HTML5 considers valid, such as a section tag.
Another option would be going back to XHTML1.1, where a table is valid inside a div (but not inside a span). Also, XHTML requires explicit closing tags, so this behavior would not show up there. (the same thing for XHTML5, though it's still invalid to wrap a table with a div in XHTML5)
Viewing the raw source would reveal that Razor is not axtually changing anything here; it is the browser. It is good to see this, though; so you know what the browser is expecting and how it's handling what you are sending it.