Welcome Guest Search | Active Topics | Sign In | Register

How to convert SharePoint Online page to PDF Options
Vinod
Posted: Thursday, March 20, 2014 5:29:42 AM
Rank: Newbie
Groups: Member

Joined: 3/20/2014
Posts: 8
Dear EO Support,

I am researching a PDF Solution to convert SharePoint Online page to PDF. I have came across EO and trying the trial version of it. however I am facing a challenge in this as below.
In our share point site we are using claims authentication. I understood that I won't be able to use the UserName / Password property since that is only for HTML "Basic Authentication" method. To use claim authentication, I have to use the authentication cookie. Since we are using sharepoint 2010, I am not able to use MsOnlineClaimsHelper because we are using .Net 3.5 which is not compatible with .Net 4.0.

We cannot use package monitor as there will be so many users and pdf needs to be generated dynamically. Code is given below.

var UserName = "XXX\XXXX";
var Password = "Abcabc";

// get cookie by MsOnlineClaimsHelper - This is not working
var cookieContainer = new MsOnlineClaimsHelper(url, UserName, Password).getCookieContainer();
var cookies = cookieContainer.GetCookies(new Uri(url));
string cookie = string.Format("{0}={1}; {2}={3}",
cookies[0].Name, cookies[0].Value,
cookies[1].Name, cookies[1].Value
);


System.Net.Cookie cookie1 = new System.Net.Cookie(cookies[0].Name, cookies[0].Value);
System.Net.Cookie cookie2 = new System.Net.Cookie(cookies[1].Name, cookies[1].Value);


HtmlToPdfOptions options = new HtmlToPdfOptions();
options.Cookies.Add(cookie1);
options.Cookies.Add(cookie2);

HtmlToPdf.ConvertUrl(url, outputPath, options);
*******************************************************************************************************
So can you please suggest a way to use EO with this requirement?
eo_support
Posted: Thursday, March 20, 2014 10:18:34 AM
Rank: Administration
Groups: Administration

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

I believe you can still use MsOnlineClaimsHelper with .NET 3.5. You can find the source code of MsOnlineClaimsHelper here:

http://www.wictorwilen.se/Post/How-to-do-active-authentication-to-Office-365-and-SharePoint-Online.aspx

The code uses Windows Identity Foundation (WIF), which has been merged into .NET Framework 4.5 but a standalone version existed for .NET 3.5, which you can download from here:

http://www.microsoft.com/en-us/download/details.aspx?id=4451

Please let us know if it works for you.

Thanks!
Vinod
Posted: Monday, March 24, 2014 8:58:50 AM
Rank: Newbie
Groups: Member

Joined: 3/20/2014
Posts: 8
Hi,
Thank you for the help and it solved my that issue. Right now when I try to use MsOnlineClaimsHelper , I am getting the below error.

"An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. "

Will you able to help me out of it?
eo_support
Posted: Monday, March 24, 2014 10:12:31 AM
Rank: Administration
Groups: Administration

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

We are not SharePoint expert so we do not know for sure either. A quick Google search yield the following result:

http://stackoverflow.com/questions/1484601/wcfan-unsecured-or-incorrectly-fault-error

So that might be something you wish to look into.

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.