+ Start a Discussion
super developersuper developer 

Conversion XML to PDF

HI Friends,

 

I uploaded a XML file in documents. After clicking a button i need to get the XML data and modify it after that i want make it as PDF  and need to send an email with this PDF as attachment.

 

PROBLEM: I am getting Problem While making modified XML  data as PDF.

 

Thanks

-----------

Radhika

Ritesh AswaneyRitesh Aswaney

Not sure of the exact problem, but if you're just looking for an approach then -

Perhaps you could include this modified xml as part of a VisualForce page and use the 'renderAs=PDF' VF Page Page Propery?

 

 

super developersuper developer

Xml content with tags displaying as it is.But I i need it in the original format. with out tags .

bob_buzzardbob_buzzard

It sounds like you'll need to use the XMLStream classes to parse your XML into usable objects.    If you do this in a controller, you can use the parsed objects in a Visualforce page as Ritesh proposed earlier.

 

There's an example of this in the Apex Developer's Guide on page 393.

Ritesh AswaneyRitesh Aswaney

If you have a look at this http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_outputText.htm

 

apex:outputText seems to have an escape attribute, which seems to let you escape html / xml text - worth a shot

 

escapeBooleanA Boolean value that specifies whether sensitive HTML and XML characters should be escaped in the HTML output generated by this component. If you do not specify escape="false", the character escape sequence displays as written. Be aware that setting this value to "false" may be a security risk because it allows arbitrary content, including JavaScript, that could be used in a malicious manner.