Is there any 3rd party tool available that would convert SharePoint pages to PDF or any custom code that converts pages to pdf?
3 Answers
You can check a tool from Muhimbi called PDF converter.
- PDF Converter for SharePoint they offer trial version so you can try it.
Also have a look on this one; https://blogs.msdn.microsoft.com/thomsven/2011/09/09/export-sharepoint-wiki-to-wordpdf-without-3rd-party-tools/
-
I can vouch for the Muhimbi tool. It does the conversions well Nov 21, 2016 at 17:25
I think your best bet would be to use a "Print to PDF" tool. There are a few programs that can do this:
- In Windows 10, "Microsoft Print to PDF" is built in
- Google Chrome has that functionality built in
- CutePDF Writer - A free program I have used for years that works with just about any OS
- Web2PDF - Convert externally available websites to PDF without needing to install anything. Never used this before, just found it after a quick search.
If you'd like to write some custom code, a good option is iTextSharp. I've been using it for years and you can dynamically create PDFs pretty easily:
protected void Page_Load(object sender, EventArgs e)
{
Document document = new Document();
try
{
PdfWriter.GetInstance(document, new FileStream("c:\\my.pdf", FileMode.Create));
document.Open();
WebClient wc = new WebClient();
string htmlText = wc.DownloadString("http://localhost:59500/my.html");
Response.Write(htmlText);
List<IElement> htmlarraylist = HTMLWorker.ParseToList(new StringReader(htmlText), null);
for (int k = 0; k < htmlarraylist.Count; k++)
{
document.Add((IElement)htmlarraylist[k]);
}
document.Close();
}
catch
{
}
}
https://stackoverflow.com/questions/2822843/itextsharp-html-to-pdf