Convert xod to pdf

4,683 views
Skip to first unread message

Marko Jovanovic

unread,
Apr 24, 2018, 2:19:34 PM4/24/18
to PDFTron WebViewer
Hello 

var pdfdoc = new PDFDoc(file);
pdftron.PDF.Convert.ToPdf(pdfdoc, file.Replace(".xod", ".pdf"));

we are trying to convert xods docuemnts to pdf, but its failing with message header not found. Basically we want to convert to pdf or any other office format (doc, ppt). Attached is the sample. 

Can you please advise how to resolve this?

Best Marko
Civil_Overview.pptx.xod

Matt Parizeau

unread,
Apr 25, 2018, 5:04:46 PM4/25/18
to PDFTron WebViewer
Hi Marko,

The first parameter that you pass to ToPdf is the output document, not the input XOD and then you need to call Save on it after calling ToPdf.
For example the following code worked for me on your file:

var pdfdoc = new PDFDoc();
pdftron
.PDF.Convert.ToPdf(pdfdoc, xodFile);
pdfdoc
.Save(xodFile.Replace(".xod", ".pdf"), SDFDoc.SaveOptions.e_remove_unused);

You can take a look at the ConvertTest sample for more examples of converting files https://www.pdftron.com/documentation/samples/cs/ConvertTest?platforms=windows

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Gisa Jovanovic

unread,
Apr 26, 2018, 1:04:20 PM4/26/18
to PDFTron WebViewer on behalf of Matt Parizeau
Hi Matt,

thank you. 

Best Marko

--
You received this message because you are subscribed to the Google Groups "PDFTron WebViewer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdfnet-webviewer+unsubscribe@googlegroups.com.
To post to this group, send email to pdfnet-webviewer@googlegroups.com.
Visit this group at https://groups.google.com/group/pdfnet-webviewer.
For more options, visit https://groups.google.com/d/optout.



--
Pozdrav, Giša Jovanović
Nova Com
Carice Teodore 26
Niška Banja
018 45 49 701
062 360 750
rex...@gmail.com
www.rexx.rs

ODRICANJE OD ODGOVORNOSTI

Informacija u ovom e-mailu namenjena je isključivo primaocima navedenim u adresi poruke. Poruka može sadržati poverljive informacije. Ukoliko greškom primite ovaj e-mail, molimo da ga obrišete. Ako niste navedeni kao primalac, svako kopiranje, korišćenje i obelodanjivanje sadržaja je zabranjeno i može biti nezakonito. NovaCom nije odgovorna, niti garantuje, za bilo koje mišljenje, preporuku, zaključak, zahtev, ponudu i/ili ugovornu obavezu koja se ostvaruje ovakvim načinom komunikacije.

DISCLAIMER

Information in this email is intended for the recipients addressed in the email. It may contain confidential information. If you receive this email in error, please delete it. If you are not addressed as the recipient, please have in mind that copying and disclosure of the email or using the information contained in the email is prohibited and may be unlawful. NovaCom neither endorses nor is responsible for any opinion, recommendation, conclusion, demand, offer and/or agreement contained in this email.



Jason D

unread,
Apr 30, 2018, 3:30:33 PM4/30/18
to PDFTron WebViewer
You can convert from XOD to PDF in the webviewer?? I thought it wasn't possible. We've been converting to xps for our webviewer users to download a local copy instead of pdf as we were under the impression you couldn't save an xod to pdf from the web. Xps has been problematic for our users.

Thanks,
Jason

Matt Parizeau

unread,
May 1, 2018, 6:55:26 PM5/1/18
to PDFTron WebViewer
Hi Jason,

The code that we're referencing here is from C# PDFNet and would be used on the server. If you're loading XOD documents in WebViewer and you want to allow users to download a PDF copy you could make a request from the client and use similar code on your server to convert the XOD to a PDF that they can download. Alternatively you could keep around the original PDF on your server and then have the client send the XFDF data (annotManager.exportAnnotations) and your server could merge it into the original PDF and return it as the HTTP response.

Matt Parizeau
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages