Welcome Guest Search | Active Topics | Sign In | Register

Can EO convert SharePoint 2013 page to PDF? Options
Hung
Posted: Wednesday, August 28, 2013 6:56:52 AM
Rank: Newbie
Groups: Member

Joined: 12/21/2011
Posts: 8
Hi EO team,

I had good experience of EO.PDF dll on SharePoint 2010. Now I need "print out PDF" function on SharePoint 2013, so I want to ask some questions:

1. Can EO.PDF dll convert ASPX page of SharePoint 2013 correctly (I means with correct CSS, style, image) ?

2. Can you used your EO.PDF dll to convert sample page below to PDF and send to my inbox (in this forum) or my personal email (phihung1313@gmail.com) for checking

Page: https://hungpham1.sharepoint.com/Pages/TestArticle.aspx
User: user@hungpham1.onmicrosoft.com
Pass: Password!

P/S: I will need feedback for the "estimation", so please reply soon. Thank you!
eo_support
Posted: Wednesday, August 28, 2013 9:51:21 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

EO.Pdf works with any website. For SharePoint 2013, you must capture the authentication cookies and pass the cookies to the converter. This way you won't hit the login page. You can use Fiddler to capture the cookies. The following code works for us:

Code: C#
HtmlToPdf.Options.Cookies.Add(new Cookie("FedAuth", "77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48U1A+RmFsc2UsMGguZnxtZW1iZXJzaGlwfDEwMDM3ZmZlODZjOTcwNWJAbGl2ZS5jb20sMCMuZnxtZW1iZXJzaGlwfHVzZXJAaHVuZ3BoYW0xLm9ubWljcm9zb2Z0LmNvbSwxMzAyMjYwMjk3MTM3OTA3MTQsVHJ1ZSxrYmduOU1KbW1Yb05BbStqZzRHTnZ0bk9LZUl3S09WNTBnbGQ0eFkwd3l0QUhoeDd6NEhqTncwUWRmQ2tTV3FDakZobm9iclhIbFNCUldEQkpsM2JxdmI2ZDBlNkZ3NjRyWnNhZGFmMHRPaU1MclFjWnhJOGF3Q3UveUFBS0VKa2hYd1BWYllTUDh5RUM0UVl3MWp3M2lmR3BxbWVuZE45MDBkZlpyVkxJc2Q4ZnRQMzdBcS8xSFFNOXpkb2ZEam5LdDFsdVhYRCtTZ2VoQ2tJeU1MVmEycitBRkdRUXg3Mm15eXIzalZLbnhvMHprWXN1QVhXYlN0U0Ztc1h2RXNZZVdTVXdZQUhrVytYSCtsMklDOStTZ2xiQXRHZS81eVBlWjVYRkdjRjNXb0VOZXNMbFdsRlRSOXdEK0NiZlRST09XRVp3SUszRmJsZ3R2M3B1Um1iZ3c9PSxodHRwczovL2h1bmdwaGFtMS5zaGFyZXBvaW50LmNvbS9QYWdlcy9UZXN0QXJ0aWNsZS5hc3B4PC9TUD4="));
HtmlToPdf.Options.Cookies.Add(new Cookie("rtFa", "HTGjhlMF/vyHrZTDwBlnr0ReBdlxAgPBsU+oEOuYn6lK8mY3DqhGPPILFfjzVtrjZQ+5zWJgE/xBMdIdTX/q0S2BbDmXV1k+/fju2VG4xgPMidfiirrY2yXff5he5ons/Jvoh0jnmOYI6H0T2eT04dtDyQzXVtZk5v67OGZP7y9JOJ5vmZnpXCZrNIZhVoTTSBmUaDVawTrMoJvTgPznC/iWKjlF1Qn9nBF0CoLtQb/H1GYgV2HjreWcLgDcBA+6/LHs3bqyauNZyfomByVItUQAf7/YRBbxnBlW9kTFutLWt+S6r0VDx1pvehVYKhqPYqIY96RJb4ar4an9JNTf+JJzbraUB2qoQl03dQbhHuUBCZ29S6zbVPEq8Icxt7/wIAAAAA=="));
HtmlToPdf.Options.Cookies.Add(new Cookie("stsSyncAppName", "Client"));
HtmlToPdf.Options.Cookies.Add(new Cookie("WSS_FullScreenMode", "false"));
HtmlToPdf.ConvertUrl("https://hungpham1.sharepoint.com/Pages/TestArticle.aspx", "result.pdf");


This code passes 4 cookies to the converter. The first two are related to authentication. The third and the fourth appears to have to do with how the contents are loaded. Once you pass these cookies, the page should convert fine.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.