 |
|
 |
Hi Al, thanks for posting the HTML-PDF article on Code Project, I got a problem when using it, it says: The application or DLL C:\Windows\system32\LIBEAY32.dll is not a valid windows image. Please check this against your installation diskette.
I do have the latest dll file, I am not sure if it is the right one because the file can't be registered (DllRegister start point cannot be found)
Can you please help me out here?
Thank you very much.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I corrected plenty of things in code, and it goes till Response.Redirect("DisplayPDF.aspx?File=" + sFile); successfully in Default.aspx page. However, it doesn't display DisplayPDF.aspx page. I am getting the following error..
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0115: 'ASP.displaypdf_aspx.GetTypeHashCode()': no suitable method found to override
Source Error:
Line 427: Line 428: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 429: public override int GetTypeHashCode() { Line 430: return -183858480; Line 431: } I am not able to fix it Any help or pointers would be highly appreciable.
Thanks Ritesh
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
The actual site appears to be http://www.htmldoc.org/[^], not the ESP company website.
It also looks like you have to manually compile your own binaries. If you want them pre-compiled, you'll have to buy a license from ESP, or Google for the old versions.
"A good scientist is a person with original ideas. A good engineer is a person who makes a design that works with as few original ideas as possible." - Freeman Dyson
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
And the stupid code doesn't even compile! What a load of junk. If it takes too long I'll just finish my xsl-fo template and get things going that route (nFOP is the rendering engine I;m playing with).
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Would be nice if some good samaritan would compile the code (for say Windows) for the open source / free version for the rest of us, or offer to post link to or provide (via email, etc.) the old versions which were precompiled but no longer available on the web.
"A good scientist is a person with original ideas. A good engineer is a person who makes a design that works with as few original ideas as possible." - Freeman Dyson
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Right now I'm under EXTREME time crunch. I'm going for the fastest route. If compiling this is teh fastest route I'll do that and post the link. If finishing my XSL-FO templates (already started) I'll compile this for everyone at some point down the line (in a month or two).
Hey, if I could get FFMPEG to compile on Windows I should be able to get this going right?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
On a side note: I smell two blog posts/ articles here. One on how to compile and get things going with HTMLDOC and the other, probably better one, is how to create reports/invoices/quotes/documents (or at least teh templates) in XSL-FO and generate both HTML and PDF output from single xml data sources. Probably add a touch of Linq2Xml and some data access tidbits in there.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi Team,
Good Morning.
Find below are the clarifications and questions regarding PDF document creation
Does your PDF creator or converter component authenticate against RSA ClearTrust Authentication and get the snapshots of webpages viewed?
In our current application we are downloading a copy of the PDF after viewing some webpages.
The new PDF shall consist of the contents of the web pages viewed.
We have ClearTrust authentication software installed in our Model Office and Production servers.
Below is the procedure that we follow for downloading the PDF.
There are 8 .aspx pages that the End User should view.
Each webpage is authenticated against the ClearTrust server and then redirected to the actual Web URL.
At the end of the 8th webpage,there is a link button control provided to download the PDF.
Below is some sample piece of code which we use
strURLPage1 = ConfigurationManager.AppSettings["PDFURLPage1"]; strURLPage2 = ConfigurationManager.AppSettings["PDFURLPage2"]; Document document = new Document(); PdfPage page = document.Pages.AddNewPage(PageSize.Letter, new Margins(10, 10, 0, 0),PageOrientation.Portrait); AddElementResult addResult; string urlToConvert = strURLPage1 + strGlobalID + "&GroupID=" + intGroupID; htmlToPdfElement = new HtmlToPdfElement(urlToConvert); addResult = page.AddElement(htmlToPdfElement); document.Save(Response, false, "MyPDFSample.pdf");
We already have purchased a software which uses the similar kind of code,but it fails in our Testing and Production Server's when we click on the Download PDF link button.
Find below the error
Could not get the metafile from url. Could not get image from url.The URL is not accessible.. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Winnovative.PdfCreator.HtmlConvertException: Could not get the metafile from url. Could not get image from url.The URL is not accessible..
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HtmlConvertException: Could not get the metafile from url. Could not get image from url.The URL is not accessible..] r.a(String A_0, lo& A_1) +176 Winnovative.PdfCreator.HtmlToPdfElement.Render(ElementsRenderer renderer) +623 Winnovative.PdfCreator.PdfPage.AddElement(PageElement pageElement) +6 LegalHold.Memos.InvestigationMemoComplete.lnkDownload_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\LegalHold\LegalHold\Memos\InvestigationMemos\InvestigationMemoComplete.aspx.cs:78 System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +90 System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +76 System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +177 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
NOTE : Please forward it to appropriate team,if I had mailed to the wrong team.
Thanks, D.Vinoth
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
I would love to figure out how to get around this issue. I have been receiving this error message for months
[HtmlConvertException: Could not get the metafile from url. Could not get image from url.The URL is not accessible..]
and I have been unable to figure out how to stop it from appearing. I don't get it when I do the conversion from my dev machine. Only from the production webserver. I checked my permissions to the project folder and all necessary users have read, write and exec privileges. This error seems to show up periodically as I haven't seen it for a few months but now, it occurs everytime the web tries to convert to pdf.
Does anyone have any idea how to work around this issue or how to prevent it??
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
Well I hope this ends up helping someone.
I was running into this error and getting NO help from anywhere on what the heck was going on. 2 months of frustration and I finally figured it out. We had a line of code in the app that was parsing the AbsoluteUri to get the full URL that it should return the PDF to. For some reason, our Firewall choked on that. Once I replaced the AbsoluteUri with the INTERNAL IP ADDRESS that the website was running off of, it worked outside the firewall just fine. Here's what the code looks like:
----------------------------------------------------------------------------------------------------------
--> THIS WAS BREAKING IT: //string urlPrefix = Request.Url.AbsoluteUri; --> REPLACED WITH THIS: string urlPrefix = "http://192.168.xxx.xx/UI";
--> COMMENTED THIS OUT: //urlPrefix = urlPrefix.Substring(0,urlPrefix.LastIndexOf('/'));
urlToPrintFrom = String.Format("{0}/{1}/PrintReport.aspx?sid={2}",urlPrefix, folder, orginalSessionId);
string downloadName = "ExportedReport.pdf";
PdfConverter pdfConverter = new PdfConverter(); pdfConverter.LicenseKey = "MY KEY HERE"; pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4; pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal; pdfConverter.PdfDocumentOptions.ShowHeader = true; pdfConverter.PdfDocumentOptions.ShowFooter = true; pdfConverter.PdfDocumentOptions.LeftMargin = 5; pdfConverter.PdfDocumentOptions.RightMargin = 5; pdfConverter.PdfDocumentOptions.TopMargin = 5; pdfConverter.PdfDocumentOptions.BottomMargin = 5; pdfConverter.PdfDocumentOptions.GenerateSelectablePdf = true; //pdfConverter.AvoidImageBreak = true;
pdfConverter.PdfDocumentOptions.ShowHeader = false; //pdfConverter.PdfHeaderOptions.HeaderText = "Sample header: " + TxtURL.Text; //pdfConverter.PdfHeaderOptions.HeaderTextColor = Color.Blue; //pdfConverter.PdfHeaderOptions.HeaderSubtitleText = string.Empty; //pdfConverter.PdfHeaderOptions.DrawHeaderLine = false;
pdfConverter.PdfFooterOptions.FooterText = "Footer"; //pdfConverter.PdfFooterOptions.FooterTextColor = Color.Blue; pdfConverter.PdfFooterOptions.DrawFooterLine = false; pdfConverter.PdfFooterOptions.PageNumberText = "Page"; pdfConverter.PdfFooterOptions.ShowPageNumber = true;
byte[] downloadBytes = pdfConverter.GetPdfFromUrlBytes(urlToPrintFrom);
HttpResponse response = HttpContext.Current.Response;
response.Clear(); response.AddHeader("Content-Type", "binary/octet-stream"); response.AddHeader("Content-Disposition", "attachment; filename=" + downloadName + "; size=" + downloadBytes.Length.ToString()); response.Flush(); response.BinaryWrite(downloadBytes); response.Flush(); response.End();
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
 |
hello, i have purchased also the pdf converter and when i try to run the application from my server i get this error. i tried to use the internal ip but it didn't solve the problem.
could someone please help????
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I can only get this to work in debug mode on the dev. machine. Can anyone help me figure out what account needs permissions on which folders?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Good day,
Plesae could you send me the source code for "HtmlToPDF.dll" or please could you update all of your Server.MapPath to reflect "~/" instead of "" or "/".
Many thanks.
|
| Sign In·View Thread·PermaLink | 2.00/5 (2 votes) |
|
|
|
 |
|
 |
Hi All
I am currently using your source code and its working fine but it is not accepting CSS. I have read the article about HTMLDOC which says that HTMLDOC 1.8 does not support CSS but HTMLDOC 1.0 supports. i downloaded HTMLDOC 1.9 and trying to find ghtmldoc 1.9 OR htmldoc 1.9 but not able to find it out..
Can anyone tell me where did i find this .exe file
Thanx in advance
|
| Sign In·View Thread·PermaLink | 2.00/5 (3 votes) |
|
|
|
 |
|
 |
Hi All
I am currently using your source code and its working fine but it is not accepting CSS. I have read the article about HTMLDOC which says that HTMLDOC 1.8 does not support CSS but HTMLDOC 1.0 supports. i downloaded HTMLDOC 1.9 and trying to find ghtmldoc 1.9 OR htmldoc 1.9 but not able to find it out..
Can anyone tell me where did i find this exe file
Thanx in advance
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
I am using this tool to convert HTML file to PDF file. The code works fine with .Net 1.1 version however it does not work with .Net 2.0. The PDF file is not getting generated. Is this code is only compatible with .Net 1.1?
Thanks
Mamta
|
| Sign In·View Thread·PermaLink | 1.67/5 (3 votes) |
|
|
|
 |
|
 |
I found an amazing html to pdf converter library for .net at http://www.dotnet-reporting.com , is the same. It has full support for HTML tags and CSS and I created a PDF report from a ASP.NET page in a few minutes. That would have taken ages with other reporting tools.
Here are a few lines of code that I used to create the report
PdfConverter pdfConverter = new PdfConverter(); pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4; pdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait; pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal; pdfConverter.PdfDocumentOptions.GenerateSelectablePdf = true; pdfConverter.PdfDocumentOptions.ShowFooter = false; pdfConverter.PdfDocumentOptions.ShowHeader = false; pdfConverter.LicenseFilePath = Server.MapPath(@"~/Bin"); byte[] downloadBytes = pdfConverter.GetPdfFromUrlBytes(MyURL);
There are other interesting PDF tools there like PDF MErge, PDF Split, RTF to PDF Converter, PDF Security tools .
Regards, Florin
HTML to PDF Converter for .NET
|
| Sign In·View Thread·PermaLink | 1.70/5 (7 votes) |
|
|
|
 |
|
 |
Hi,
If you need a professional library for .NET that converts ASP.NET page, html pages (basically any web url) or only html strings to pdf, here is an interesting tool: www.html-to-pdf.net
Here is some code example:
PdfConverter pdfConverter = new PdfConverter();
pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4; pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal; pdfConverter.PdfDocumentOptions.ShowHeader = true; pdfConverter.PdfDocumentOptions.ShowFooter = true; pdfConverter.PdfDocumentOptions.LeftMargin = 5; pdfConverter.PdfDocumentOptions.RightMargin = 5; pdfConverter.PdfDocumentOptions.TopMargin = 5; pdfConverter.PdfDocumentOptions.BottomMargin = 5; pdfConverter.PdfDocumentOptions.UseMetafileFormat = true;
pdfConverter.PdfDocumentOptions.ShowHeader = false;
pdfConverter.PdfFooterOptions.FooterText = "Sample footer: " + TxtURL.Text + ". You can change color, font and other options"; pdfConverter.PdfFooterOptions.FooterTextColor = Color.Blue; pdfConverter.PdfFooterOptions.DrawFooterLine = false; pdfConverter.PdfFooterOptions.PageNumberText = "Page"; pdfConverter.PdfFooterOptions.ShowPageNumber = true;
pdfConverter.LicenseFilePath = System.IO.Path.Combine(Server.MapPath("~"), "Bin"); byte[] downloadBytes = pdfConverter.GetPdfFromUrlBytes(url);
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response; response.Clear(); response.AddHeader("Content-Type", "binary/octet-stream"); response.AddHeader("Content-Disposition", "attachment; filename=" + downloadName + "; size=" + downloadBytes.Length.ToString()); response.Flush(); response.BinaryWrite(downloadBytes); response.Flush(); response.End();
|
| Sign In·View Thread·PermaLink | 2.00/5 (6 votes) |
|
|
|
 |
|
 |
That's pretty useless.... I thinkyou'll find most ASP.NET apps don't have HTML files lying around to convert.
More helpful would be an article on how to convert the output from your ASP.NET page to PDF.
|
| Sign In·View Thread·PermaLink | 1.00/5 (5 votes) |
|
|
|
 |
|
 |
I sometimes become amazed with what 'you some people' tell about others's posts. Just have a look at what you say: " That's pretty useless.... I think you'll find most ASP.NET apps don't have HTML files lying around to convert.
More helpful would be an article on how to convert the output from your ASP.NET page to PDF. "
To which my question is:
Isnt the ouptput of an 'asp.net page' html ?
Alexander German
|
| Sign In·View Thread·PermaLink | 4.63/5 (4 votes) |
|
|
|
 |
|
 |
Wow.. Sounds like you're pretty useless. I'm sure you're a hell of an asp developer... Brilliant!
|
| Sign In·View Thread·PermaLink | 1.33/5 (3 votes) |
|
|
|
 |
|
 |
When I run source demo. It's Ok But When I run Buton1 to convert HTML to PDF THis line "Server.Execute(sUrlVirtual, sw);" Run many times and request the page:"default.aspx " many times I can not run demo source any more
Please help me
|
| Sign In·View Thread·PermaLink | 2.75/5 (4 votes) |
|
|
|
 |
|
|
 |
|
|
 |