Let’s assume I manually exported an existing PDF file to an XML format file; this is trivial, indeed.
Now: is there any way to bind this file/stream to a PDF document?
As I can see, there are two PDF class members: BindFO and BindXML.
I tried to bind the PDF document with this XML file:
FileStream xmlFS = new FileStream("Test.xml", FileMode.Open, FileAccess.Read);
Pdf pdf = new Pdf();
pdf.BindXML(xmlFS, null);
As I can see with my debugger, there is no actual binding; probably, I will need to use a schema or to define a second parameter.
How will I define this second parameter (XSLT??) in this case?
Or - is this function not applicable to XML files generated by Adobe?
Hi,
Thank you for considering Aspose.
Please check the following link.
http://www.aspose.com/wiki/default.aspx/Aspose.Pdf/HelloWorldXmlAndXslt.html
Hope it helps.
Thanks.
Adeel Ahmad
Support Developer
Aspose Changsha Team
http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html
It is great and I saw this sample before, indeed...
But there’s a question about XLT file from Adobe and practical usability of this function.
As I can see, Aspose doesn’t let us direct import of .pdf files to PDF document.
So, to bind pdf document with existing pdf files we need
a) Export pdf to xml;
b)To obtain somewhere a standard XLT from Adobe or to build it ourselves.
Am I right?
Where we can get this XLT?
We have not supported binding existing Pdf directly. Your idea is interesting. I don’t know if we can find such a XLT you need but can you tell me how do you export pdf to xml? Can you please provide an example of the xml? If your method can export Pdf to xml well, we can consider support such XML in Aspose.Pdf.
Tom,
Right now both namespaces, Aspose.pdf and Aspose.pdf.kit have very little practical value for most developers – sorry to tell you this. For a beginning, the separation of functionality for existing and new PDF files was a mistake, but there’s a more important thing: that the Aspose.pdf.kit functionality is very limited. Many developers won’t be satisfied with the offered ways of extractin plain text and images. Who cares about this stuff, by the way? Everybody can do it without expensive software, simply with various features of Adobe Acrobat.
But most modern applications will require complete or partial information about formats, paragraphs, fonts, images positions, etc. This information (theoretically, according to your documentation) is placed in various collections of your PDF document, but the impossibility of binding with a real PDF file forces developers to find other ways.
It is extremely easy to EXPORT PDF file content to XML. Open Adobe software, run Adobe Acrobat, toolbar menu File, Export, choose XML – and voila! Done! You have an XML file; this file will be probably slightly different for each Adobe release. Can you, folks, make a small investigation?
You can make this Adobe XLT as a default, by the way. As a result, you will have a real import feature and binding with existing PDF files in Aspose.pdf, and we, developers, will be able to get detailed info and use Aspose to build real-world applications! Thank you!
Thanks very much for your comment! You suggestion is great appreciated. We will investigate this issue and try to support it in the future version.