Note that there are some explanatory texts on larger screens.

plurals
  1. POConvert style-laden HTML tables to PDF, in .NET 1.1
    primarykey
    data
    text
    <p>I have colleagues working on a .NET 1.1 project, where they obtain XML files from an external party and programmatically instruct iTextSharp to generate PDF content based on the XML data.</p> <p>The tricky part is, within this XML are segments of arbitrary HTML content. These are HTML code users copied and pasted from their Office applications. Still looks ok on a web browser, but when this HTML is fed into iTextSharp's HTMLWorker object to parse and convert into PDF objects, the formatting and alignment run all over the place in the generated PDF document. E.g.</p> <pre><code>&lt;span id="mceBoundaryType" class="portrait"&gt;&lt;/span&gt; &lt;table border="0" cellspacing="0" cellpadding="0" width="636" class="MsoNormalTable" style="margin: auto auto auto 4.65pt; width: 477pt; border-collapse: collapse"&gt; &lt;tbody&gt; &lt;tr style="height: 15.75pt"&gt; &lt;td width="468" valign="bottom" style="padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0in; width: 351pt; padding-top: 0in; height: 15.75pt; background-color: transparent; border: #ece9d8"&gt; &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt; &lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt; &lt;/td&gt; &lt;td colspan="3" width="168" valign="bottom" style="padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0in; width: 1.75in; padding-top: 0in; height: 15.75pt; background-color: transparent; border: #ece9d8"&gt; &lt;p style="margin: 0in 0in 0pt; text-align: center" class="MsoNormal" align="center"&gt; &lt;u&gt;&lt;font face="Times New Roman"&gt;Group&lt;/font&gt;&lt;/u&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>The tags are full of Style attributes, and iTextSharp does not support CSS and interpreting that attribute. What are some alternatives other iTextSharp users have tried to workaround this, or other feasible HTML-to-PDF components?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload