NReco pdf generator issue - wkhtmltopdf

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.

Related

Outlook Ignores Width attribute or css property

I've seen this problem touched on in many questions but none have been specific enough to help me. So I hope it offends no one if I simplify it and ask again. Hope springs eternal!
Is it really IMPOSSIBLE to control the width of an image embeded in an email when Outlook renders it? I.e. control the width of an image for which the html code is
<img src="cid:seal">
I.e. when the html code expects an embedded image instead of one stored elsewhere.
[Note: "seal" is the content ID I assigned when creating the MimeBodyPart with the embedded image].
Details:
I use a Javamail application to send a multi-part email message. The body part is an html document. Another MimeBodyPart carries the image used in the html doc. I've simplified the html test to nothing more than a two column table with the left column for the image and the right column for text.
And absolutely NOTHING I have tried has been able to control the size of the image when opened in OUTLOOK.
The image is always what I assume must be some native size for the image ... which is too big ... so it forces the first cell to be more than 15% wide. Or if I give the cell a fixed width the image overflows the box, i.e. get's clipped.
I put the basic code stripped of all font styling colors etc. below.
I have tried every combination of using width attributes and css style properties on the img tag. I've wrapped the image in another table ... or wrapped it in a div block inside the main table cell ... and even wrapped it in a div block inside a table cell inside the parent table cell. And I've tried specifying widths in fixed pixels and %'s.
It would really be nice if we all knew for sure if this is simply IMPOSSIBLE with Outlook.
Or if it is possible possible, to publish sample code that works. [It's hugely attractive to have the email open its images immediately, and not rely on the reader downloading them.]
NOTE: I seem able to control width when I load the image from an outside source afterwards, i.e.
Thanks for any help.
<html>
<head>
<meta name="viewport" content="width=980, initial-scale=1">
<title>Test Email</title>
</head>
<body style="width:100%; border:0;margin:0;padding:0;">
<table align="center"
style="width:980px; border-collapse:collapse;
margin-left:auto; margin-right:auto;">
<tr style="border:0; margin:0; padding:0;">
<td style="width:15%; border:0; margin:0; padding:0;">
<img src="cid:seal"
style="width:6em; height:auto;">
</td>
<td style="width:85%; margin:0; padding:.5em 0em 0em 0em; border:0;">
Some Titles and stuff
</td>
</tr>
<tr>
<td colspan="2" style="border:0; margin:0; padding:1em 1em 0em .5em;">
<p> 1st paragraph
....
<p> last paragraph
</td>
</tr>
</table>
With help from Eugene above, I discovered at least one good solution.
<img src="cid:seal" width="300" or "300px" of "15%"> DOES NOT WORK.
But when I ditched the quotes this worked
<img src="cid:seal" width=300 height=300>
It does of course mean setting width in % is still a problem since it requires quotes.
But I'll take what I can get. Email now pops open with logo without the user needing to download pictures. AND ... this css body selector also works rendering the background with an embedded image. [I stored the background image with a Content ID of"bkg".]
AGAIN ... unlike the img attribute src="cid:id" that uses quotes, url() requires the id w/o quotes.
<body style="background-image:url(cid:bkg);
background-repeat:repeat;
width:100%;
generic-family:Sans-serif;
font-family:Verdana;
border:0;margin:1em 0 1em 0;padding:0;">
Outlook uses Word as an email editor. The following series of articles provides reference documentation related to supported and unsupported HTML elements, attributes, and cascading style sheets properties:
Word 2007 HTML and CSS Rendering Capabilities in Outlook 2007 (Part 1 of 2)
Word 2007 HTML and CSS Rendering Capabilities in Outlook 2007 (Part 2 of 2)
You can design the page in Word and then save the resulted document as a web page. Thus, you will find the required HTML markup to use.

Floating images in Github Readme

How would I go about doing this? Putting the following code into the
Markdown generator
gives me the desired output
<div style="float: left"><img src="http://ompldr.org/vaDU5NQ/scrotter.png"/>
</div>
I'm trying not to, kid. Don't act so surprised, Your Highness. You weren't
on any mercy mission this time. Several transmissions were beamed to this
ship by Rebel spies. I want to know what happened to the plans they sent
you. Kid, I've flown from one side of this galaxy to the other.
I've seen a lot of strange stuff, but I've never seen anything to make me
believe there's one all-powerful Force controlling everything.
However, adding this code to my README.md file makes it an inline image instead
of floating.
How could I work around this? Is it a Github bug?
I know this thread's old, but for anyone interested, you can use <img align="left" src="img.jpg"> and <img align="right" src="img.jpg"> to float images on GitHub.
I believe it is a security issue with GitHub. My understanding is they strip all HTML attributes such as style with the execption of perhaps href.

How to comment out comment in Doxygen documentation

I am using Doxygen's \page, \subpage and \section constructions to make overview documentation for my application. Somewhere in this I am using HTML to create a nicely formatted table.
However, I want to remove a part of the table in the output, without removing the comment itself. E.g.
/*!
\page MAINPAGE Main Page
<table>
<tr>
<td>Do This</td>
<td>100</td>
</tr>
<tr>
<td>Do That</td>
<td>200</td>
</tr>
<tr>
<td>Yet another one</td>
<td>300</td>
</tr>
</table>
I want to remove the line containing 'Do That' without removing the 'text' itself from the file.
If this were simple source code, I could simply comment this out using // or /* */.
I found out that I could use \if or \latexonly (we only generate html output) but both seem a workaround (looks like using if(false) in code to comment out a block).
Isn't there a clean way to comment out comment in Doxygen?
Did you try \cond \endcond tags? It's described here http://www.doxygen.nl/manual/commands.html#cmdcond
http://www.doxygen.nl/manual/commands.html#cmdendcond
Enclose the part to be excluded within #cond and #endcond blocks. Like so:
#cond DOXYGEN_EXCLUDE
<tr>
<td>Do That</td>
<td>200</td>
</tr>
#endcond
and ensure that you have not defined DOXYGEN_EXCLUDE in any place that doxygen can see. DOXYGEN_EXCLUDE is just what I use, it not a special keyword, you can choose any name you prefer.
Besides \cond...\endcond you can also use HTML comments, i.e <!-- this is a comment in a comment --> inside doxygen comments, as explained at the bottom of this page in the manual http://www.doxygen.org/manual/htmlcmds.html

Only one page is generated with XSL-FO Page-Break Problem?

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.

Does increased the size of width to 10000px in <td> so as to load correctly in IE8 has any bad effects

I have an application which was built on IE6 which runs comfortably on IE7 as well as FF.But coming to IE8 all the CSS is completely broken and ruined the application.
In the course of fixing the broken CSS it came to know most of the places its only width that was previously working is not getting proper width of which it being provided explicitly for all the required .
Now on trail error method we had started off the value with 400px to more and finaly ended at 8000px where all the issues are resolved and the backward compatibilty is also fine with IE6 and IE7
<td><div class="cornerOuterLL"></div></td>
<td class="containerOuter containerOuterPadding fullWidth" style="width: 4700px;"></td>
<td><div class="cornerOuterLR"></div></td>
</tr>
I know I am not solving the actual problem but found a solution,which not sure whether it effects the performance or not? whether the approach is correct
Thanks
Try adding this meta tag in the head section, and see if it works..
<meta http-equiv="X-UA-Compatible" content="chrome=1">

Resources