Open renjithrainy opened 8 years ago
this is the output file pdfoutput.pdf
The issue is not with printing ascii character, but the issue seems to be related to with header positioning. I see that the header and content comes when i use Pechkin but the content is not visible now. Please let us know if you have any thoughts. I am still working on it. Plz see following code:
InitializeTuesPechkinConverter();
GlobalConfig gc = new GlobalConfig();
gc
.SetDocumentTitle("Test document")
.SetPaperSize(PaperKind.Letter);
IPechkin pechkin = Factory.Create(gc);
ObjectConfig oc = new ObjectConfig();
oc.SetCreateExternalLinks(false);
oc.SetFallbackEncoding(Encoding.ASCII);
oc.SetLoadImages(false);
oc.Header.SetHtmlContent("E:/htmlcontent.htm");
oc.Footer.SetLeftText("[page]");
try
{
byte[] result = pechkin.Convert(oc, "<html><body><table><tr><td>My Website</td></tr></table></body></html>");
System.IO.File.WriteAllBytes(@"E:\Learning\pdfoutput.pdf", result);
}
catch (Exception ex)
{
}
We also have the same problem. We can not add the header via 'SetHtmlContent'. Although I noticed, that body content is sometimes shown if html is structured with divs...
Did you find the solution?
@tvolge you may need to watch the converter for an Error
event. If you are attempting to pass in a file path to which the running process cannot obtain access, it may cause some problems.
@tuespetre an Error
event doesn't trigger, nor Warning
event. If header and footer consist of simple and short HTML like <div>foo header</div>
they show up, BUT main html content does not. If I don't speciffiy the header html, then the main html content shows. If header is more than only one simple div, it does not show.
Any idea / rule about specific html structure that won't cause this behavior?
Hello I am using html url to populate the header part of the pdf. But I see that the header and main content are not coming but instead a junk ascii character is shown at the top. Below is my code. Could you please tell me what is wrong in this? thanks in advance