We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

HttpReadType

Thread ID:

Created:

Updated:

Platform:

Replies:

98532 Mar 8,2011 12:04 AM UTC Mar 9,2011 09:03 AM UTC ASP.NET Web Forms (Classic) 3
loading
Tags: PDF
Travis Powell
Asked On March 8, 2011 12:04 AM UTC

Hello, How do I resolve this error?

Error 34 The type 'Syncfusion.Pdf.HttpReadType' exists in both
'C:\Windows\assembly\GAC_MSIL\Syncfusion.Pdf.Base\9.103.0.20__3d67ed1f87d44c89\Syncfusion.Pdf.Base.dll' and

'D:\Perforce\Current\Portal\WebGui\ASPX\Bin\syncfusion.pdf.base.dll'

D:\Perforce\Current\Portal\WebGui\ASPX\ExportQueue.aspx.cs 293 76 D:\...\ASPX\

And is there anyway to pass cookies to HTML to PDF from String conversion?



Geetha M [Syncfusion]
Replied On March 8, 2011 07:23 AM UTC

Hi Travis,

Thank you for your interest in Syncfusion products.

1. To solve the Error:
You can avoid the error by removing the assemblies from the local folder (Bin).

2. HTML To PDF:
It is possible to convert a HTML string to PDF. You may use the HTML string from the cookies as in the code given below.

PdfDocument pdf = new PdfDocument();
PdfPage page = pdf.Pages.Add();
int width = (int)page.GetClientSize().Width;

string html = Request.Cookies["Name"].Value;

using (HtmlConverter converter = new HtmlConverter())
{
converter.EnableHyperlinks = true;
converter.EnableJavaScript = true;

using (HtmlToPdfResult result = converter.Convert(html, ImageType.Metafile, width, -1, AspectRatio.KeepWidth))
{
PdfMetafileLayoutFormat format = new PdfMetafileLayoutFormat();
format.Layout = PdfLayoutType.Paginate;

result.Render(page, format);
}
}

pdf.Save("Sample.pdf", Response, HttpReadType.Save);
pdf.Close(true);

Please try this and let us know if you have any questions.

Regards,
Geetha


Travis Powell
Replied On March 8, 2011 06:34 PM UTC

Hi Geetha,

Thank you so much for the update. I'm wondering if it's possible to submit cookies to the converter as well. I haven't found any methods that allow me to send cookies, but I'm sure there must be a way.

Thanks!

Travis


Geetha M [Syncfusion]
Replied On March 9, 2011 09:03 AM UTC

Hi Travis,

Sorry for the confusion.

With the current implementation of HtmlConverter, it is not possible to access the webbrowser’s properties to and it does not have the support to add the cookies to the target response.

Please let us know if you have any other questions.

Regards,
Geetha


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;