abcpdf gecko not rendering images - asp-classic

I'm attempting to make a PDF from a HTML document, and this document has images absolutely linked (ie. C:/somewhere/html.htm), but when I use abcpdf 8.1 AddImageUrl("file:\\"&absLocation,True,0,False) the resulting pdf doesn't have any images.
Does anyone have any idea how to get the images to show up?
Side info: when using vbscript and default mshtml as the engine, it all gets saved to pdf perfectly, but in asp it didn't save at all using mshtml. Thus the switch to Gecko.
I'm using this on a Windows Server 2008 R2 Standard 64-bit machine with IE9.

I figured it out! I had to prepend file:// to my image references within the html as well.
So IMG elements should look like this:
<img src="file://c:\directorys\image.png" alt="There should be an image here />

Related

IIS renders embedded font icons incorrectly

I have a static web page that displays icons embedded in one of the css references. The icons are not displayed properly and we see some junk characters instead when browsed to from IIS. The same web page when opened directly in the browser seems to render fine. I wonder if it is some misconfiguration in the static page website but I am unable to figure out what the issue could be. Would greatly appreciate any help to solve this issue.
The page when rendered by IIS:
The page when rendered by browser directly:
Looks like the CSS file is the issue.
The css file when browsed to via IIS:
The original css file opened with the browser:
If you use extended styles and sass syntax, when SASS does the compression, it changes Font Awesome characters from escaped ASCII sequences to unicode. So you need to add <meta charset="utf-8" /> in the head to let the browser know how to interpret it.

Winnovative - PDF generated as image instead of text

I am using winnovative tool to generate PDF.
My problem is PDF which is getting generated is Image not as text.
This issue exists in all browser (Mozila, Chrome and IE)
Is there any fix for this?
Regards,
Sagar
You are using a very old version of the software. The current version you can download from http://www.winnovative-software.com/download.aspx should work very well.

Print HTML page using "FontA11" of EPSON

I want to print my HTML page from browser using the fonts "FontA11". How can I use this fonts for my page?
I want to print this using browser. I am going to make web app for my client and they are using EPSON printer to print.
I have set my Epson (TM-U220D, Model: M188D) printer as default and I am able to see the fonts "FontA11" in Microsoft word. It also prints using this fonts when printed from Microsoft word.
Now, I want to print my HTML page from browser using this fonts but its not working. I have also tried NOT setting "font-family" to my css and check which fonts it takes but even that is not working.
I know "FontA11" is printer fonts and we can't refer those in HTML page but I want a way through which my page outputs with "FontA11" fonts.
Can anybody help?
I am using EPSON TM T82, Windows 7, Internet Explorer, and these steps would work for me.
Devices and Printer>Printing Preferences>Printer Settings>True Type Font Substitution>Substitute>Advanced Settings>Tick Substitute All>Set Device Font Name>OK>Apply.
Google Chrome will not work for me.
Save the page to disk, open it in Word, ctrl-A to select everything, change font to FONT11A, print?

Abcpdf 8 with ASP.Net - Missing images in PDF for some users

We're using ABCPDF.Net 8 to generate PDF documents for users. The HTML source is loaded directly as a string and images are defined in the HTML with the full path. Example:
<img id="img1" src="file://D:/trakit/images/cl_logo.gif" alt="" />
This works beautifully and we have about 200 users generating PDFs with no problem.
The problem is that a few handful of users are not getting the images in the PDF. The images are replaced by the image placeholder that is shown by IE when an image is not found.
This happens consistently for some users only. I cannot figure out what is wrong as the PDF is generated server-side and should not have anything to do with the user's browser settings. I agree that the page/code is running under the user's permissions (we use windows authentication), but why should this affect PDF image generation? Below is the code snippet to generate the PDF:
PDFDoc.Rect.Inset(20, 20)
PDFDoc.Page = PDFDoc.AddPage()
li_PDFID = PDFDoc.AddImageHtml(as_HTML, True, 1050, True)
While PDFDoc.Chainable(li_PDFID)
PDFDoc.Page = PDFDoc.AddPage()
li_PDFID = PDFDoc.AddImageToChain(li_PDFID)
End While
For li_Loop = 1 To PDFDoc.PageCount
PDFDoc.PageNumber = li_Loop
PDFDoc.Flatten()
Next
Return PDFDoc.GetData()
Any help will be greatly appreciated.
Thanks.
Update: Just found that if the user users another browser (such as Firefox), the images then generate fine. This narrows down the problem to IE 7/8 on the user's computer. Any suggestions?
Okay. The issue was finally found and has nothing to do with ABCPDF.
Seems part of the HTML source was coming from the user's browser - obtained using javascript function innerhtml() on IE. And I just found out that IE has a big problem with innerhtml()
All sorted now.

A "shortcut" method for exporting an ASP.Net Page to pdf/xls

I want to export a few Pages to pdf/xls. By Pages I mean as the eye sees it - a screenshot of the Page's contents. I know how to build pdf/xls documents using 3rd party tools but is there any way to quickly export the rendered contents of say a Panel?
edit: maybe a tool that can render the page's output as a browser would, and save it as an image file?
There is an open source console program named wkhtmltopdf which you could call from asp.net to convert the page. It can convert to PDF or an image with wkhtmltoimage (JPG, PNG, etc.) using the webkit rendering engine.
Check my answer to this question to see an example of how to convert from a html to a pdf using C#:
Easiest way of porting html table data to readable document
I can recommend http://www.screengrab.org/ for firefox.

Resources