Hi Srinivasa,
Hi, I could fix this issue but the Formatted Text alignment goes wrong... not retaining \n \t character formatting.
XML for ex:
<?xml version=\"1.0\" standalone=\"no\"?>\n\n\t\n\t\t1\n\t\t<Text type=\"String\">\n TEST REPORT Page 1\n \n CUSTOMER: Regression Print File\n \n DATE: 6 16, 2009\n \n \n CHECK NO. INVOICE NO. REMITTER AMOUNT\n---------------------------------------------------------------------------------------------\n 833272 H70240 TESTER DANIELS COMPANY 20,261.12\n H71270\n H71279\n\t\n\t\t
*** H71270\n H71279 are supposed to align with H70240 and been working fine with PDF version 3.6.0.0, but not with version 7.4.0.0
XSL FO parsing this text is ..
<fo:block font-family="monospace" white-space-collapse="false" wrap-option="no-wrap"
linefeed-treatment="preserve"
white-space-treatment="preserve">
Thanks
Srini
Hi Srinivasa,
Pdf pdf = new Pdf();<o:p></o:p>
string strPath = "ReportFileList_SRM_pdf.xsl";
var xmlDocument = new System.Xml.XmlDocument();
xmlDocument.LoadXml("d:/pdftest/SRM-XML.Xml");
var xslDocument = new System.Xml.XmlDocument();
xslDocument.Load(strPath);
pdf.BindFO(xmlDocument, xslDocument);
pdf.IsTruetypeFontMapCached = true;
pdf.TruetypeFontMapPath = "d:/pdftest/";
pdf.Save("d:/pdftest/BindXML_Issue.pdf");
Hi, I am no longer getting XSL compile error and able to download with XML data and XSL provided.. I got the LineFeed formatting being preserved but \t tabspace is not being preserved with newer 7.4.0.0 DLL.
Can you confirm whether formatted text '\t' works? I can confirm '\n' is working fine.
Thanks
Srini
I emailed the code snippet, XML data and XSL files last evening in Zip format to Codewarrior. Please find it or else would email again.
SriniD100:I emailed the code snippet, XML data and XSL files last evening in Zip format to Codewarrior. Please find it or else would email again.
Aspose.Pdf.Generator.Pdf pdf = new
Aspose.Pdf.Generator.Pdf();<o:p></o:p>
string strPath = @"D:\pdftest\New Folder\";
StringBuilder strNewPathXsl = new StringBuilder();
strNewPathXsl.Append(strPath);
if (!strNewPathXsl.ToString().EndsWith("\\"))
{
strNewPathXsl.Append('\\');
}
strNewPathXsl.Append("ReportFileList_SRM_pdf.xsl");
var xmlDocument = new System.Xml.XmlDocument();
xmlDocument.LoadXml( @"D:\pdftest\New Folder\SRM-XML.Xml");
var xslDocument = new System.Xml.XmlDocument();
xslDocument.Load(strNewPathXsl.ToString());
pdf.BindFO(xmlDocument, xslDocument);
pdf.IsTruetypeFontMapCached = true;
pdf.Save(@"D:\pdftest\New Folder\PDFFILE.pdf");
Do you have anumber I can dial?
Hi Srinivasa,
Hi Nayyar,
I emailed a zipped file containing the XSL, XML, C# as well as AsposeTrueFontMap.XML files on last friday. I have tried same with version 7.4 and 7.5, the output works fine except retaining Tabspace.
Expected Format of the output is
CUSTOMER: Regression Print File
DATE: 6 16, 2009
CHECK NO. INVOICE NO. REMITTER AMOUNT
---------------------------------------------------------------------------------------------
833272 H70240 ARCHER DANIELS MIDLAND COMPANY 20,261.12
H71270
H71279
H72322
............................... as in HTML format, but PDF returns with below output:
CUSTOMER: Regression Print File
DATE: 6 16, 2009
CHECK NO. INVOICE NO. REMITTER AMOUNT
---------------------------------------------------------------------------------------------
833272 H70240 ARCHER DANIELS MIDLAND COMPANY 20,261.12
H71270
H71279
H72322
834762 H71264 ARCHER DANIELS MIDLAND COMPANY 14,008.32
H71281
H72218
.. Subsequent lines mis-aligned.
FYI, This was working fine with older version of 3.4 DLL. Can you specify what properties need to be set to retain HTML nature of the content?
Hi Srinivasa,
Hi,
I am using .Net 4.0 and xmlDocument.LoadXML() only has String as argument, not path as in your attachment/snapshot. I copied the file content to String Property "s" as in Attachment and LoadXML() loads to the document and shows in MessageBox.. Can you please use it as String as well?
Thanks
Srini
Hi Srini,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
I tried using the XML string instead of file path but I am getting “'\' is an unexpected token. The expected token is '"' or '''. Line 1, position 15.” Exception. When I checked your shared XML file, it is using a lot of unexpected “\” characters in tags. I tried opening the XML file in XML Editor and it does not open it as well. Please share your XML file again with your sample application so we can sort out the problem soon.
We are sorry for the inconvenience,