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

Free Support Forum - aspose.com

Aspose.Pdf.Generator.Text with IsHtmlTagSupported Not Working Correctly

I am trying to create pdf using Aspose.Pdf.Generator.Text with IsHtmlTagSupported enabled.

I’ve ran into a few issues while trying to do the following:

1. Assigning name to the html form field
eg: Text text1 = new Text("");
When I examined the generated textfield in Adobe Acrobat, the name was autogenerated guid.

2. Although this worked in my WCF webservice, in Window Forms Application this produced a blank PDF.
eg: Text text2 = new Text("");

3. Combinations of the two issues above, I got System.ApplicationException: Non-unique field name when I tried to create two radio buttons with the same name.
eg: Text text3 = new Text("");

I have also included a sample C# file I wrote using Window Forms Application.
I am using .net 3.5 and Aspose.Pdf 9.2.0.0

SJeong:
1. Assigning name to the html form field
eg: Text text1 = new Text("");
When I examined the generated textfield in Adobe Acrobat, the name was autogenerated guid.
Hi Sung,

Thanks for contacting support.

I have tested this scenario and have observed that no name is being assigned to form field when converting HTML to PDF format. For the sake of correction, I have logged it in
our issue tracking system as PDFNEWNET-36954.
We will investigate this issue in details and will keep you updated on the
status of a correction.


SJeong:
2. Although this worked in my WCF webservice, in Window Forms Application this produced a blank PDF.
eg: Text text2 = new Text("");
Please note that a form field should have name else it won’t be added to PDF document.

SJeong:
3. Combinations of the two issues above, I got System.ApplicationException: Non-unique field name when I tried to create two radio buttons with the same name.
eg: Text text3 = new Text("");
Please note that form fields should have unique names and they should not have identical names. Furthermore, I am unable to notice any exception.
1. Thanks!

2. I am still experiencing the same issue even after putting in name.
Text text2 = new Text("");

3. How would I go about grouping radio buttons without assigning the same name? HTML allows different form fields to share the same name for grouping purposes.

Edit (5/12/14 3:24 PM GMT -5:00):
4. I am also trying to put textarea inside a table cell (included in the 2nd attachment). I am still using IsHtmlTagSupported. I'm getting a blank pdf for simple case and stack overflow when I put style on the table.

SJeong:
2. I am still experiencing the same issue even after putting in name.
Text text2 = new Text("");
Hi Sung,

Thanks for sharing the details.

I have tested the scenario and I am able to
reproduce the same problem that when trying to render HTML contents containing RadioButton, the resultant file is not being generated. In fact the resultant file being generated is 0KB. For the sake of correction, I have logged it in our
issue tracking system as PDFNEWNET-36965.

SJeong:
3. How would I go about grouping radio buttons without assigning the same name? HTML allows different form fields to share the same name for grouping purposes.
As shared above, if HTML string contains RadioButton, the resultant PDF being generated is 0KB and so is the case in this scenario. I have noticed that resultant PDF of 0KB is being generated when using html string with two radio button objects with similar name. I have associated this information with earlier reported PDFNEWNET-36965 and development team will definitely consider this scenario during the resolution of this problem.

SJeong:
4. I am also trying to put textarea inside a table cell (included in the 2nd attachment). I am still using IsHtmlTagSupported. I’m getting a blank pdf for simple case and stack overflow when I put style on the table.
The problem might be occurring because table tag is not properly defined. However when using following string, the resultant PDF is properly being generated. For your reference, I have also attached the resultant PDF generated over my end.

String html = String.Format("<table border=“1”
style=“width:300px”>

{0} ", text);
4. Found a work around using textbox with large height

Has there been any progress on the fix, ETA? I'd like it resolved as soon as possible. This fix is needed for me to meet the costumer's requirements.

SJeong:
4. Found a work around using textbox with large height


Hi Sung,

It is good to know you have managed to get your desired results.

SJeong:

Has there been any progress on the fix, ETA? I’d like it resolved as soon as possible. This fix is needed for me to meet the costumer’s requirements.

I am afraid your issue is not resolved as we have recently noticed the issue and it is pending for investigation in the queue with other priority tasks. As soon as its investigation completes then we will share an ETA.

We are sorry for the inconvenience caused.

Best Regards,

The issues you have found earlier (filed as PDFNEWNET-36965) have been fixed in Aspose.Pdf for .NET 9.7.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
I am unable to get these to work.

SJeong:
1. Assigning name to the html form field
eg: Text text1 = new Text("");
I am still seeing the same problem. The name is was different than what I assigned it to be.

SJeong:
2. Although this worked in my WCF webservice, in Window Forms Application this produced a blank PDF.
eg: Text text2 = new Text("");
Still seems to be producing blank pdf.

SJeong:
3. Combinations of the two issues above, I got System.ApplicationException: Non-unique field name when I tried to create two radio buttons with the same name.
eg: Text text3 = new Text("");
Not getting the exception anymore, but still producing a blank pdf.

I have tested these using Aspose.Pdf for .NET 9.7.0 from NuGet + .NET 3.5.

Hi Sung,


Thanks for your patience. In reference to above stated fix, please use new DOM approach to add HTML string in PDF document. It will help you to accomplish the task.


string outFile = “36965.pdf”;<o:p></o:p>

Document doc = new Document();

Page page = doc.Pages.Add();

HtmlFragment text2 = new HtmlFragment("");

page.Paragraphs.Add(text2);

doc.Save(outFile);

Please feel free to contact us for any further assistance.


Best Regards,

The issues you have found earlier (filed as PDFNEWNET-36954) have been fixed in Aspose.Pdf for .NET 11.3.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.