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

Free Support Forum - aspose.com

Is it posible to write a function that receives an xml object and convert it to pdf?

Hi i'm new when it comes to use aspose, and I want to make a function that take a xml object and return a pdf file, also I understand that aspose use an specific schema for the xml files (TextFragment and etc..), so im worried it may not work If I pass an xml file that dont follow that schema, here a I left a little basic structure of a function to illustrate what im trying to do.

public Document getPdfByXml(Document documentXml) {

	 return documentXml;


Thanks for contacting support. Can you please visit documentation article Generated PDF from XML. This will help you to achieve your requirements. Please share feedback with us if there is still an issue.

Hi thanks for the response, is it posibble to pass an object of type document rather than just root directory of the file?


We regret to inform that it is not possible using Aspose.PDF.

Ohh, well… Anyways, thanks for your help.

1 Like