Hi
Hi Arthur,
We are sorry for the inconvenience faced. While testing the scenario with Aspose.Pdf for NET 8.5.0, we’ve managed to reproduce this issue on our side and logged it as PDFNEWNET-35985 in our bug tracking system for further investigation and resolution. We’ve also linked your request to this issue and you will be notified via this thread as soon as it is resolved.
Please feel free to contact us for any further assistance.
Best Regards,
Tilal
Hi Arthur,
Hi Arthur,
Thanks for your patience.
We have further investigated the issue PDFNEWNET-35985 reported earlier and it does not seem to be an issue with Aspose.Pdf for .NET. Please note that BindXML expects that the summary XML that it will get after applying XSLT to the supplied XML will contain special tags related to the PDF document object model. Something like the following XML must be generated after translation:
<?xml version="1.0" encoding="utf-8" ?>
<Pdf xmlns="Aspose.Pdf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="Aspose.Pdf
C:\PROGRA~1\Aspose\ASPOSE~1.NET\Xml\Aspose.Pdf.xsd"
DestinationType="FitPage">
<section1
ID="section1"
PageMarginLeft="1cm"
PageMarginRight="1cm"
PageMarginTop="4.5cm"
PageMarginBottom="3.5cm"
PageSize="A4">
<PageBorder>
<All BorderStyle="Normal"/>
</PageBorder>
<!-- Contenu de la première page -->
<Image ID="id1" File="PDFNET-15770-1.gif" Type="Gif"
FixHeight="5cm" FixWidth="15cm" Alignment="Center"
MarginTop="1cm"/>
<Image ID="id2"File="PDFNET-15770-2.gif"Type="Gif"
FixHeight="10cm"FixWidth="15cm"Alignment="Center"MarginTop="1cm"/>
<Text MarginLeft="2cm" MarginRight="2cm" FontName="Arial" MarginTop="1cm">
<TextBorder>
<All BorderStyle="Normal"/>
</TextBorder>
<Segment IsTrueTypeFontBold="true" FontSize="12">
Commentaires :#$NL
dsfk mkf mskdf skdfm skdf ldkf mslkfdsmdfkms
dfkmkf;koki mslmkf mkmfk mlkf lkf mkmsfk l kmfksmfmskf
ifmks lkfm smkmfk s#$NL
sdfjfhsdfhdsjf lkf fjslkfdljflskdfpokmlkrt dmlfkger
lkvgdhjh fhkjhdhfyez ajd s#$NL
sdfjfhsdfhdsjf lkf fjslkfd ljflskdfpokmlkrt
dmlfkger lkvgdhjh fhkjhdhfyez ajd s#$NL
sdfjfhsdfhdsjf lkf fjslkfdljflskdfpokmlkrt
dmlfkger lkvgdhjh fhkjhdhfyez ajd s#$NLS
sdfjfhsdfhdsjf lkf fjslkfkjflskdfpokmlkrt dmlfkger
lkvgdhjh fjklmj sfg ldk lkdjfa#$NL
sdfjfhsdfhdsjf lkf fjslkfdljflskdfpokmlkrt
dmlfkger lkvgdhjh fjdkjfkjfhgyl
</Segment>
<Segment>
sdfjfhsdfhdsjf lkf fjslkfdljflskdfpokmlkrt
dmlfkger lkvgdhjh fjklm j;sjdxgkg kjdfkjslkdjf
</Segment>
</Text>
<!-- Contenu de la deuxième page -->
<Image ID="id3" File="PDFNET-15770-3.gif" Type="Gif"
FixHeight="10cm" FixWidth="15cm" Alignment="center"
MarginTop="1cm"/>
<Image ID="id4" File="PDFNET-15770-4.gif" Type="Gif"
FixHeight="10cm" FixWidth="15cm" Alignment="center"
MarginTop="1cm"/>
</section1>
</Pdf>
However, as we can see from the set of sample files, the customer’s set of XML+XSLT generates HTML, which will not (and should not) be correctly processed with the BindXML method. Please get HTML from XML + XSLT and then use BindHTML to get the desired results.
Hi codewarior,
As per my requirement I have to take data from XML and use custom XSL to generate PDF Which I am able to do with first approach but not using second approach.
I have tried as below post
To generate the PDF, I have tried 2 approaches-
-
Transformed XML data with XSL and converted into HTML then Using Aspose.HTML, converted HTML to PDF(It’s working as expected using same .xml and .xsl files)
-
When I am trying to use Aspose.PDF please check below code. Pdf is generating and is not opening because it’s blank pdf. Even I have used same xml which suggested by Farhan (Programmers Guide)
and try to generate PDF using XML only it’s generating BLANK PDF.
If XML schema is not proper in attached snapshot please share the updated valid XML so I can use below code for my requirement.2.PNG (8.6 KB)
Document pdf = new Document();
using (FileStream fs1 = new FileStream(xmlpath + "Examples.xml", FileMode.Open))
using (FileStream fs2 = new FileStream(xmlpath + "Examples.xsl", FileMode.Open))
{
// Bind the XML file
pdf.BindXml(fs1, fs2);
// Save the resultant PDF
pdf.Save(xmlpath + "Examples.pdf");
}
I am achieving requirement using first approach but I don’t have ASPOSE.Html lic but I have for ASPOSE.Pdf.lic
Thanks in advance
We have addressed your concerns in other thread created by you. Kindly follow up in respective thread.
Thank you so much for help.