We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Casting error when exporting so Aspose.Pdf

When I try to export my reports to Aspose.Pdf I am getting an error on my Report Server that says “Cannot cast type ‘Aspose.PDF’ to type ‘Aspose.PDF’”. Is there something that I can do to not get this error anymore? Exporting to Aspose.Doc and Aspose.HTML work without any problem using Aspose.words and I’m pretty sure I set them all up the same way.

Hello Matthew,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We apologize for your inconvenience. If it does not violate your privacy can you please share the code and resource files so that we can test this issue at our end.

Hi Matthew,

Can you please provide the detailed error message or a screen snap?

The error is now gone and it seems to be exporting correctly now. I didn’t change anything except leave for the weekend and come back. But at least it’s working now :slight_smile:

It is still not formatting correctly, however, with the HTML tags. It successfully removed the HTML tags from the text, but it doesn’t seem to be formatting. The content has

  • tags. Would this be some sort of limitation because of having the evaluation version that maybe if I get a license would work?

I’m having trouble with the export to Aspose.PDF not formatting HTML content correctly. It successfully removed the HTML tags from the text, but it doesn’t seem to be formatting. The content has

tags. Would this be some sort of limitation because of having the evaluation version that maybe if I get a license would work?

Hello Matthew ,

Tags are supported in Aspose.Pdf but before I comment more over this topic, could you please share with us, either you are using a text string (being added to a PDF document) that contains HTML tags? Or trying to convert HTML file into Pdf that contains these Tags.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Moreover, In order for us to test the issue, could you please share the resource file and code snippet that you are using.

Hi,

This problem is not caused by evaluation version. The HTML feature is Beta version and it is not supported well. If you can provide your code we will try to resolve the problem in the future version. Sorry for the inconvenience.

We are using a text string that contains HTML tags. The report is basically set up as a table that’s using a SQL statement to pull information from the database and place in the table. I’ve attached the resource file and the text that is being entered into each field. Please let me know if you need any more information on this.

We are using a text string that contains HTML tags. The report is basically set up as a table that's using a SQL statement to pull information from the database and place in the table. I've attached the resource file and the text that is being entered into each field. Please let me know if you need any more information on this.

Hello Matthew,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I have created a pdf file using "report.txt" that you have shared. The pdf file in my case is formatting

  • Tags properly. Following is the code that I have used to generate the pdf file.

Pdf pdf = new Pdf();
Aspose.Pdf.License lic = new Aspose.Pdf.License();
lic.SetLicense("Aspose.Custom.lic");

Aspose.Pdf.Section sec1 = pdf.Sections.Add();
StreamReader sr = new
System.IO.StreamReader(@"C:\pdftest\report.txt");
sr.BaseStream.Position = 0;
string content = sr.ReadToEnd();
sr.Close();

Text firstText = new Text(content);
firstText.IsHtmlTagSupported = true;
sec1.Paragraphs.Add(firstText);
pdf.Save("C:/pdftest/HTMLtest.pdf");

The logic in above code snippet is different from your business logic, it’s showing the support of HTML tags in Aspose.Pdf. The resultant file is in attachment. Please take a review and incase of any concerned issues, feel free to share.

Hello,

I'm not exactly sure where you're putting this code that you've included? I am using Visual Studio's Report Designer to design the report and then using the Report Server's Report Manager to render the report and do not have anywhere to write code snippets like this. From there, there is an export format dropdown that now lists multiple options from Aspose. I've attached the way that I'm getting to the export option and what my PDF looks like after selecting the PDF via Aspose.Pdf option. Maybe this will help clear up where my problem is occurring and how I'm coming to this issue.

Thank you!

Hello Matthew,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

As I mentioned in my post, that the code example is not according to your requirement. As I mentioned, It simply shows the capability of Aspose.Pdf to render

  • Tags are formats the output according to HTML tag.

You are absolutely correct that while using SQL server Reporting Services there is no such place where you can place a code. Sorry for causing this confusion. I will discuss your issue with our development team and will update you with the status of resolution shortly.

Hi Matthew,

Sorry for the inconvenience!

Some tags from HTML are not supported in the current version,including the tages you used in your report, so the rendered PDF report is not displayed as you hoped.

we would enhance the capability of Aspose.pdf for RS to support more HTML tags in the later version.

Is there somewhere to get a list of what HTML tags are currently supported in PDF? Or is there any estimate as to when the next version of Aspose.Pdf might be coming out?

Hi,

You can find the supported tags at http://www.aspose.com/documentation/file-format-components/aspose.pdf-for-.net-and-java/working-with-text-containing-html-tags.html. Currently the HTML feature is beta version and we can't support all HTML tags in short time. But we will try to support your requirement first. Sorry foe the inconvenience.