I am trying to create PDF file from XML using XML-FO file. XML-FO file is written through XSLT 2.0. It Throws syntax error in “pdf1.BindFO(foData, foStyle);”.
Hi Jay,
Hi Jay,
Moreover, as a work around you can use some third-party utility (e.g : http://p2p.wrox.com/xslt/42785-does-net-2-0-framework-support-xslt-2-0-a.html ) and then just pass summary XML to BindFO() method, with single argument.
The issues you have found earlier (filed as PDFNEWNET-36175) have been fixed in Aspose.Pdf for .NET 8.8.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
I tried version 8.8.0. I am still having same error.
Hi Jay,
using System;<o:p></o:p>
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Saxon.Api;
namespace SaxonicaTestDrive
{
class Program
{
static void Main(string[] args)
{
// please put here path to Your license file for Aspose.Pdf.dll
// otherwise only very simple source documents can be processed
new Aspose.Pdf.License ().SetLicense(@" C:\SaxonicaTestDrive\ProcessedFiles\Aspose.Total_Fresh.lic");
// do XSLT to get result XSLFO
string sourceXmlFile = @"C:\SaxonicaTestDrive\ProcessedFiles\Data.xml";
string xsltFile = @"C:\SaxonicaTestDrive\ProcessedFiles\XSLT-FO-XSLT 2.0.xsl";
string productXslFoFile = @"C:\SaxonicaTestDrive\ProcessedFiles\result.xml";
DoXsltTransformation(sourceXmlFile, xsltFile, productXslFoFile);
// convert product XslFo to PDF with Aspose.Pdf.dll
Aspose.Pdf.XslFoLoadOptions foToPdfLoadOptions= new Aspose.Pdf.XslFoLoadOptions();
foToPdfLoadOptions.UseOldXslFoEngine=false;
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(productXslFoFile,foToPdfLoadOptions);
// save result
string pdfOutputPath = @"C:\SaxonicaTestDrive\ProcessedFiles\output.pdf";
pdfDocument.Save(pdfOutputPath);
}
public static void DoXsltTransformation(String sourceUri, String xsltUri, String productXml)
{
// sample can be found here :
// http://www.xmlplease.com/saxonaspnet
// Create a Processor instance.
Processor saxProcessor = new Processor();
// Load the source document.
XdmNode rootNode = saxProcessor.NewDocumentBuilder().Build(new Uri(sourceUri));
// Create a transformer for the stylesheet.
XsltTransformer transformer = saxProcessor.NewXsltCompiler().Compile(new Uri(xsltUri)).Load();
// Set the root node of the source document to be the initial context node.
transformer.InitialContextNode = rootNode;
// BaseOutputUri is only necessary for xsl:result-document.
transformer.BaseOutputUri = new Uri(xsltUri);
// Create a serializer.
Serializer serializer = new Serializer();
serializer.SetOutputFile(productXml);
// Transform the source XML to System.out.
transformer.Run(serializer);
}
}
}
I am getting This error with trial version of Aspose.Pdf 8.8.0 “{“At most 4 text fragments can be added in evaluation mode.”}”
Hi Jay,
Thanks for your inquiry. To test the feature with Aspose.Pd for .NET 8.8.0 without evaluation limitation, you may request for 30 days temporary license. Hopefully it will help you to accomplish your requirements.
Please feel free to contact us for any further assistance.
Best Regards,
It worked, Thank you.
When I tried To generate PDF, PDF generated successfully but It does not contains images I am trying load using URL. I am getting this messages while it is generating “Attempt to resolve URI ‘http://nanonull.com/nanonull.gif’ failed”
Hi Jay,
problem as PDFNEWNET-36311 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 are sorry
for this inconvenience.
// load XSL-FO file<o:p></o:p>
Document doc = new Document(@"C:\pdftest\images-embedded.fo", new XslFoLoadOptions());
// save the output in PDF format
doc.Save(@“C:\pdftest\images-embedded_DOM.pdf”);
<o:p></o:p>
Aspose.Pdf.XslFoLoadOptions foToPdfLoadOptions= new Aspose.Pdf.XslFoLoadOptions();
foToPdfLoadOptions.UseOldXslFoEngine=false;
// load XSL-FO file
Document doc = new Document(@"C:\pdftest\images-embedded.fo",foToPdfLoadOptions);
// save the output in PDF format
doc.Save(@"C:\pdftest\images-embedded_DOM.pdf");Hi Jay,
the sake of correction, I have separately logged this problem as PDFNEWNET-36314 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 are sorry for this inconvenience.
<o:p></o:p>
The issues you have found earlier (filed as PDFNEWNET-36314) have been fixed in Aspose.Pdf for .NET 9.6.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi Jay,
// convert product XslFo to PDF with
New XslFoEngine<o:p></o:p>
Aspose.Pdf.XslFoLoadOptions foToPdfLoadOptions = new Aspose.Pdf.XslFoLoadOptions();
foToPdfLoadOptions.UseOldXslFoEngine = false;
// load XSL-FO file
Document doc = new Document(@"C:\pdftest\images-embedded.fo", foToPdfLoadOptions);
// save the output in PDF format
doc.Save(@"C:\pdftest\images-embedded_DOM.pdf");