|
 |
|
|
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 | |
|
|
|
 |
|
|
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 | |
|
|
|
 |
|
|
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 | |
|
|
|
 |
|
|
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 | 2.00/5 (2 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.67/5 (6 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.PdfHeaderOptions.HeaderText = "Sample header: " + TxtURL.Text; //pdfConverter.PdfHeaderOptions.HeaderTextColor = Color.Blue; //pdfConverter.PdfHeaderOptions.HeaderDescriptionText = string.Empty; //pdfConverter.PdfHeaderOptions.DrawHeaderLine = 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 (5 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 (3 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 | 5.00/5 (2 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 | 3.00/5 (3 votes) |
|
|
|
 |
|
|
 |
|
|
 |
|
|
I download your project then have error exception :
"Failed to map the path '/'. "
at code public PDFGenerator(string sDirectory) { sFontSize = ""; sLandScape = "--landscape"; m_sWaterMark = ""; string sRoot = Server.MapPath("/"); <--- this line error m_sDrive = "" + sRoot[0]; m_Directory = sDirectory; } in PDFGenerator.cs
what should I do? help me please. thank you.
|
| Sign In·View Thread·PermaLink | 1.86/5 (4 votes) |
|
|
|
 |
|
|
 |
|
|
I'm executing a line like this one : ' C:\Proyectos>C:\Proyectos\Pragma.Common.Utils\Pragma.Common.Utils\Html2PDF\ghtmldoc.exe --webpage --quiet --bodyfont Arial --datadir "C:\Proyectos\Pragma.Common.Utils\Pragma.Common.Utils\Html2PDF\" --charset 8859-1 --outdir "C:\Proyectos\Pragma.Web.UI.Controls\Pragma.Web.UI.Controls.Test\" -t pdf14 -f cines.pdf http://cinesargentinos.com.ar/ ' but the generated PDF contains invalid characters, for example "É" is "Ø" . do you have any idea how solve this issue?
sorry by my english. thank you Fernando.-
Chicho.-
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
hello,Albert! first,thanks for your souce! i downloaded your source and run the exe file ,but it seems to have something wrong , because when i convert default pages of sites to pdf type,the words in the pdf are in confusion.When i generated to pdf type there are a lot of errors like :cannot open *.afm. Or maybe i forget to do somgthing,because i can see the files that in the error list. can you help me?
thanks a lot!
成长的烦恼
|
| Sign In·View Thread·PermaLink | 2.00/5 (2 votes) |
|
|
|
 |
|
|
Hi Albert Pascual,
Ur project HtmlToPdf works fine. But when i see the output in pdf file it contains "default" an extra header which was not present in html. would u suggest a method to get rid from it.
Jhanna Lal
|
| Sign In·View Thread·PermaLink | 2.00/5 (2 votes) |
|
|
|
 |
|
|
Hi Albert, Can v use the CS Class file in ASP 2.0 version too??? Wld d code work fine in 2.0 version??? in case not den cld u kindly let me know how i can implement d same in 2.0 version? kindly respond ASAP, Its Urgent...
Ravneet
|
| Sign In·View Thread·PermaLink | 2.67/5 (3 votes) |
|
|
|
 |
|
|
There are many articles about converting HTML to PDF, Text to PDF or extract Text from HTML... However how can we convert from PDF to HTML??
I have tried the same manner with PDFtoHTML from Sourceforge.net but it doesn't satisfy me since PDFtoHTML doesn't support Unicode well.
I have also tried to implement automation with Adobe Acrobat 7.0 (base on this information) with no success.
Try Dim gApp As Acrobat.CAcroApp Dim gPDDoc As Acrobat.CAcroPDDoc Dim jso As Object
gApp = CreateObject("AcroExch.App") gPDDoc = CreateObject("AcroExch.PDDoc")
If gPDDoc.Open("c:/Test.pdf") Then jso = gPDDoc.GetJSObject ' Export Test.pdf to Test.xml jso.saveAs("/c/test.xml", "com.adobe.acrobat.xml-1-00") End If Catch ex As Exception MessageBox.Show("Errrror") End Try
I got a bug in jso.saveAs command : "NotAllowedError: Security settings prevent access to this property or method". Tried to change the Security preferences in Adobe Acrobat but things stay the same.
Any solution for converting PDF to HTML???
|
| Sign In·View Thread·PermaLink | 2.00/5 (3 votes) |
|
|
|
 |
|
|
I am a novice .net user. i downloded the code and from this site. Do I have to download the software htmldoc from that site? I have not doenloaded thinking the ghtmltopdf.exe is coming with the project. when I am trying to run the code I am getting error as follows:
An unhandled exception of type 'System.StackOverflowException' occurred in System.Web.d
can u help me plz
|
| Sign In·View Thread·PermaLink | 1.67/5 (3 votes) |
|
|
|
 |