HTML data is not in the correct format

I have the following XML :

<?xml version="1.0" encoding="utf-8" ?>



Comments


<Text FontName="Helvetica" FontSize="7" CharSpace="0.1" MarginLeft="15" MarginTop="3" MarginBottom="3" MarginRight="0" IsHtmlTagSupported="true">
<p> My &Test </p>




When I am generating the PDF , I am not getting the Text in the proper format.

Java : Aspose 2.7.0

Code Sample :

Pdf pdf = new Pdf();

pdf.bindXML(new StringBufferInputStream(data), null);

pdf.save("C:\\AsposeTest\\config\\test\\My_TEST_PDF_12.pdf");

Hello Sriman,

Thanks for using our products.

I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFJAVA-27924. We will investigate this issue in details and will keep you updated on the status of a correction. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We apologize for your inconvenience.

Whenever there is "&" or "<" in the segment under a text marking as IsHtmlTagSupported=true, its failing to generate the pdf.

I tried with & and <, still its not wotking. Do u have any solution/workaround for this ?

Hello Sriman,

In recent release version, there is an issue while rendering Text paragraph inside PDF document when we call setIsHtmlTagSupported(...) method for the text object. For the sake of correction, we already have logged this problem as PDFJAVA-27983 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

If I am missing something, please share some more details regarding the approach you are following to generate the PDF.

If I write a string inside a Text tag with IsHtmlSupported=true then all the fonts are coming in small letters. However if the letters are Bold, Itallic then its coming correctly.

Any suggestion.

Hello Sriman,

Thanks for your patience and sorry for replying you late.

Are you facing this problem while converting XML file into PDF format ? because during my testing with normal text object containing HTML tags inside section element, I am unable to notice any problem. Please share some details. We apologize for your inconvenience.

PS, If possible, please share the code/XML contents so that we can test the scenario at our end.

Yes, I am getting this issue when converting a XML into a PDF.

Here is the sample XML :

<?xml version="1.0" encoding="utf-8" ?>


<Table ColumnWidths="100%" DefaultCellPaddingTop="3" DefaultCellPaddingLeft="4" DefaultCellPaddingRight="4"
DefaultCellPaddingBottom="3">

Comments

<p>Approving Print Proposal</p>


Ideally it should come as : Approving Print Proposal

But its coming as : approving print proposal

Hi

Thanks for your patience. I have tested the scenario using Aspose.Pdf for Java 2.9.0 and I am unable to notice any problem. Can you please try using the latest release version and in case you encounter any problem or you have any further query, please feel free to contact. We apologize for your inconvenience.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

For your reference, I have also attached the latest PDF document that I have generated using Aspose.Pdf for Java 2.9.0

The issues you have found earlier (filed as 27924 ) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Still the issue persists and has not been fixed completely.

<?xml version="1.0" encoding="utf-8" ?>



Comments


<Text FontName="Helvetica" FontSize="7" CharSpace="0.1" MarginLeft="15" MarginTop="3" MarginBottom="3" MarginRight="0" IsHtmlTagSupported="true">
My <Test  pdf




This should give me a pdf with "My <Test pdf". But its throwing exception. All the html tags should be taken care.

While we copied some data from MS word it comes along with the html tags (as below). In this case aslso the PDF generation failed.

<?xml version="1.0" encoding="utf-8" ?>



Comments



This upsize reflects.

We would note that .

The proposed line :

Core tier once capital less 1.5%)

Dwe , pro-forma operating 7.0%)

For a detailed credit (5).

Key

  • Announcement of PILU.
  • HunPilu.





Even this simple html is not working :


This upsize reflects.

We would note that .

The proposed line :

Core tier once capital less 1.5%)

Dwe , pro-forma operating 7.0%)

For a detailed credit (5).

Key

  • Announcement of PILU.
  • HunPilu.

sulthu:

Still the issue persists and has not been fixed completely.

<?xml version="1.0" encoding="utf-8" ?>



Comments


<Text FontName="Helvetica" FontSize="7" CharSpace="0.1" MarginLeft="15" MarginTop="3" MarginBottom="3" MarginRight="0" IsHtmlTagSupported="true">
My <Test  pdf




This should give me a pdf with "My <Test pdf". But its throwing exception. All the html tags should be taken care.



Hi,

I have tested the scenario and I am able to notice the same problem. There seem to be a problem while converting this specific XML file into PDF format. For the sake of correction, I have logged this problem as PDFJAVA-30897 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time. We apologize for this inconvenience.
sulthu:

While we copied some data from MS word it comes along with the html tags (as below). In this case aslso the PDF generation failed.

<?xml version="1.0" encoding="utf-8" ?>



Comments



This upsize reflects.

We would note that .

The proposed line :

Core tier once capital less 1.5%)

Dwe , pro-forma operating 7.0%)

For a detailed credit (5).

Key

  • Announcement of PILU.
  • HunPilu.







sulthu:
Even this simple html is not working :


This upsize reflects.

We would note that .

The proposed line :

Core tier once capital less 1.5%)

Dwe , pro-forma operating 7.0%)

For a detailed credit (5).

Key

  • Announcement of PILU.
  • HunPilu.

I have managed to reproduce the same problem and its been logged in our issue tracking system as PDFJAVA-30898.We will further look into the details of these problems and will keep posted on the status of correction. Please be patient and spare us little time. We are really sorry for this inconvenience.

Besides this, the issue PDFJAVA-27924 reported earlier seems to be fixed in v3.0.1. For your reference, I have attached the resultant PDF that I have generated.

Hi,

When can I expect a fix for these issues ?

Got another issue. Here I have generated PDFs from the below XML by using Aspose 2.7.0 and 3.0.1 separately. Please look into the generated PDF. PDF using 3.0.1 Jar is having unnecessary spaces in between lines and paragraphs.

XML :

<?xml version="1.0" encoding="utf-8" ?>

My test - test type

Status: Draft

Page $p of $P

Printed : 03-11-2010

<Table ColumnWidths="100%" DefaultCellPaddingTop="3" DefaultCellPaddingLeft="4" DefaultCellPaddingRight="4"

DefaultCellPaddingBottom="3">

Comments

<p>This upsize reflects a normalization of credit lines (Testing Data). </p><p> </p><p>We would note that this line increase will enable us to win the Cricket World Cup 2011. </p><p> </p><p>The proposed line is within appetite for this name: </p><p> ABC of USD 30mm and 0.8% of test &amp;#39;s (including the EUR &amp;#39;s will be 12.5%)</p><p> DSE of USD 300mm is Test will be 8.0%)</p><p> </p><p>For a detailed TEST DATA </p><p> </p><p><u>Key Recent events since last </u></p><ul><li>Announcement of TEST.</li><li>outlook (from negative) by TEST.</li></ul>

Hi,

Could you please provide an update?

Thanks

Hi,

Its a gentle reminder.

When can we expect a solution for these issues ?

Hi,

Knock....Knock..... Is anybody there ?

Why are you people not replying ? Is everything OK ?

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

Sorry for the delay in response.

We have received a feedback from our development team and as per the development team; this is not a bug in Aspose.PDF for Java. The XML file is not configured correctly. The entity   is not one of XML's predefined entities.

There are two solutions:

1) use   for a non-breaking space;

2) you have to provide a DTD that declares what it means:
<?xml version="1.0"?>
<!DOCTYPE some_name [

]>

Sorry for the delay and inconvenience,

I tried xml given in the reply : 339622 with the above solutions but could not succeed. The big gap between the lines are still coming and is not the same format as 2.7.0.

I need the same format as we get from Aspose 2.7.0 jar.

If you have the pdfs then please share. Please use the latest Aspose pdf Jar 3.0.1