I want to open a web page and save it as pdf. I have to use chrome's "Save as Pdf" feature. I dont want to use any paid library. Is it possible to open html page in chrome browser and save it as pdf programatically in c#.
No you can not save html page as a PDF without any third party DLL like iTextsharp and many others which are available in Free.
So, you can use this Free DLL for save as PDF.
Related
How can I connect cshtml content to ejs-pdfviewer, I want to use it as andvantage to be able to print I want I have set into the PdfViewer with syncfusion, is it possible?'
Is there any attribute I have to add to enable this functionality, or is there a special way to achieve this in syncfusion?
Below is the cshtml code :
<ejs-pdfviewer id="container" style="height: 600px"
serviceUrl="/api/PdfViewer"
documentPath="#Path"
enablePrint="true">
</ejs-pdfviewer>
Currently, PDF Viewer do not have support to display the cshtml page directly. However, we can convert the cshml to PDF and then we can load that PDF document in PDF Viewer. We have created the sample for the same and shared in the following location,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/ViewToPDF_Core1313262793
In the above sample click on ‘ConvertToPDF’ to load the cshtml page in PDF Viewer.
PDF Viewer:
UG link: https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/
Reference links for Html to PDF Conversion:
UG: https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit
KB: https://www.syncfusion.com/kb/9779/how-to-convert-html-to-pdf-in-azure-using-net-core
MVC view to PDF (.NET Framework): https://www.syncfusion.com/kb/6024/how-to-convert-mvc-view-to-pdf-using-c-and-vb-net
Note: For converting HTTPS sites, the HTML converter requires OPENSSL libraries to be installed in the machine where the conversion takes place. Please find the below link for reference
https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#openssl
Regards,
Ramya T
Some help needed with clicking link in downloaded pdf file.
With C#, Selenium and AutoIt , i have downloaded a pdf file. Now i want to open that pdf file and click on dynamic link that is placed in page 2.
I was able to open pdf but didnt got to know how to click link in pdf. some help needed
Web driver does not support clicking links inside a PDF - use an open source pdf API - Apache pdfbox- this will extract all the links and then you can navigate further with webdriver.
I have created an excel file using EPPlus library, is there a short way to show it in the webpage without writing lots of codes ?
One solution would be to embed your report as a PDF or as a large PNG/Jpeg.
Another solution would be to embed a PDF using pdf.js
http://mozilla.github.com/pdf.js/
This allows javascript to render a PDF without using any additional plugins, etc. (although it does need a HTML 5 browser)
http://mozilla.github.com/pdf.js/web/viewer.html
I want to display Pdf file inside iframe control.I have added my code like this below.
in asp page,
<iframe width=500 height=500 runat="server" id="myPDF" src="pdf_003.pdf"></iframe>
in page_load
myPDF.Attributes.Add("src", "pdf_003.pdf");
When i run the project, then the pdf file is not visible inside the iframe.Instead of this, it shown the save as dialog box for save to disk or open in pdf reader.
it is correctly shown in internet explorer but not any other browser...
How do i view the pdf file inside iframe control in all other browser?
Please Guide me to get out of this issue?
You need to change Acrobat Reader's settings so it will display PDF files on the browser itself.
See this Adobe KB article
Hi I am embedding pdf file to my asp.net page like this
<object data="..." type="application/pdf" width="300" height="200">
</object>
The problem is that I have created my own toolbar for pdf, and want to zoom in, out document from my toolbar image buttons. I know that I can embed JavaScript to pdf document, when creating document from scratch, but how can I embed javascript to pdf in html having only the path of that document?
Let the pdf document load. Once the document is ready, inject Javascript.
However, note that Javascript, as executed by your browser is different from the Javascript executed by the Adobe reader plugin for your browser. The structure is similar but the DOM is entirely different.
Further, Javascript in your HTML document cannot directly access/modify the DOM of the loaded pdf document. For that you will need to go through the reader plugin. I am sorry I have not used the reader plugin in this way. Take a look at the API:
http://www.adobe.com/devnet/acrobat/pdfs/js_api_reference.pdf
and also read this guide:
http://www.adobe.com/devnet/acrobat/pdfs/Acro6JSGuide.pdf
These may be your best bet because very few people on SO seem to be working on Javascript for pdf. I have asked a few questions before but never got any responses :(