Convert pdf2xod and xod2pdf

805 views
Skip to first unread message

Lior Sapir

unread,
Sep 30, 2016, 12:48:04 PM9/30/16
to PDFTron WebViewer
Hello all,

What should it take to convert pdf to xod in order to edit the file, and in order to save it as pdf => convert from xod back to pdf? The reason I'm asking is because Pdftron over IE11 works and display the pdf file very very slow, while displaying xod is much faster.

I'd appreciate your answer.

Regards,
Lior.

Matt Parizeau

unread,
Oct 3, 2016, 4:42:00 PM10/3/16
to PDFTron WebViewer
Hi Lior,

You could use PDFNet to convert from PDF to XOD or vice versa https://www.pdftron.com/pdfnet/samplecode.html#WebViewer. You can also store your annotations in XFDF format and then merge them back into the PDF on demand using PDFNet.

Let me know if that makes sense or if you'd like more clarifications.

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Lior Sapir

unread,
Oct 4, 2016, 12:24:41 PM10/4/16
to PDFTron WebViewer
Hi Matt,

One other thing, what should be installed on the pc so xod will be displayed after the the conversion from pdf? Also, can webviewer 2.2.1 convert pdf2xod and xod2pdf?

Regards,
Lior.

Lior Sapir

unread,
Oct 4, 2016, 12:24:43 PM10/4/16
to PDFTron WebViewer
Hiw Matt,

Thank you for replying.
Can you please tell me how it should be donr, both ways? What is the relevant code that should be used from pdf2xod and xod2pdf?

Regards,
Lior.

Kristian Hein

unread,
Oct 4, 2016, 7:33:07 PM10/4/16
to PDFTron WebViewer
Hi Lior,

WebViewer can not convert documents. You will need to use PDFNet or DocPub.

See here for an example of converting from PDF to XOD.


-Kristian

Lior Sapir

unread,
Oct 5, 2016, 7:13:33 PM10/5/16
to PDFTron WebViewer
Hello,

I have the license needed to convert to xod and to pdf.
I'm having troubles rotating a single page, deleting a single page, after adding the relevant buttons to the toolbar, the won't work on xod but on pdf the do work. Any suggestions how it can be resolved?
(xod loads much faster then pdf over IE10/IE11, hence needed this help).

Regards,
Lior.

Kristian Hein

unread,
Oct 6, 2016, 10:13:45 PM10/6/16
to PDFTron WebViewer
Hello Lior,

XOD files are read only. It is not possible modify them client side.

Instead, it is recommended to keep the original PDF file on the server, and use PDFNet to apply the "split/remove/rotate/etc" commands on the original PDF, and then generate a new XOD from the original (but now modified) PDF. Unless you call PDFDoc.Save and write to the original file location, then any changes you make to the PDF are "temporary".

-Kristian

Lior Sapir

unread,
Oct 7, 2016, 5:05:14 PM10/7/16
to PDFTron WebViewer
Hello Kristian, et al.

Since we're using IE11 and IE10 as a constraint (the platform is crm dynamics 2011), displaying PDF over WebViewer.PDF is too slow while XOD is being displayed like no-time,we must have the option to manipulate the pdf file (or xod) but we also need not to dry out the end-user who keeps on waiting for the PDF to load using the WebViewer. Since we do need to keep the rotated file, delete single pages, or so..., Is the another offer to use in order to make this work properly and faster?

Thanks,
Lior.

Kristian Hein

unread,
Oct 11, 2016, 9:43:43 PM10/11/16
to PDFTron WebViewer
Hello Lior,

I understand that you need the document to load quickly. This is why you should still use XODs.

Since there is no way to modify the XOD what you would need to do is keep the original PDF on your server and modify it instead. After a rotate/delete the server can modify the PDF accordingly and reconvert to XOD and reload the page with the modified XOD. In this way you keep the quick loading of XODs and are still able to rotate/delete pages.

-Kristian

Lior Sapir

unread,
Oct 13, 2016, 7:54:03 PM10/13/16
to PDFTron WebViewer
Hello Kristian,

Thanks for your answer.

This is what I thought and considered as the procedure that should be done. 

However:

1. Converting to XOD => Able to do so since I have also the license for PDFNet SDK (entire package).

2. Rotating, or what so ever the user want's to do with the file, over the XOD - WebViewer's job (capabilities).

3. Affecting the PDF - If I've loaded PDF as an XOD, how can I affect the PDF if the file loaded is the XOD? How do the changes made over the XOD can take affect over the PDF file?

Thanks,
Lior.

Kristian Hein

unread,
Oct 17, 2016, 9:17:32 PM10/17/16
to PDFTron WebViewer
Hello Lior,

To make the changes take affect on PDF, you need to make a call to your server with changes you want (ie rotatation/deletion). After making the changes the server can then re-convert to XOD.

Lior Sapir

unread,
Oct 18, 2016, 8:39:45 PM10/18/16
to PDFTron WebViewer
Hello,

I still don't understand.
The xod is the "manipulated" pdf so The performence would be better for loading and displaying The file over internet explorer. So, If the XOD is displayed, how can I affect the original PDF?

Thanks,
Lior.

Matt Parizeau

unread,
Oct 19, 2016, 1:59:32 PM10/19/16
to PDFTron WebViewer
Hi Lior,

If you want to change the original PDF then you'll need to store a copy of the original PDF on your server. At the time that you want to apply any permanent changes to the PDF you would have custom JavaScript code that would, for example, send a POST request to your server with information about the changes that you want to have applied to the original PDF. Maybe you would send your server something like this:
{
  deletedPages
: [1, 2, 3],
  rotatedPages
: [4]
}

Your server would receive this information and use PDFNet to delete and rotate those pages on the original PDF. Now that the original PDF is updated you can convert it to XOD using PDFNet and then if you like you can notify WebViewer to load the new XOD document.

It's up to you to implement a server end point that can receive messages like I mentioned above and run the necessary PDF code to update the PDF. Hopefully that clarifies what we're describing, but let us know if you have any further questions.

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Lior Sapir

unread,
Oct 20, 2016, 1:22:07 PM10/20/16
to PDFTron WebViewer
Hello,

Thanks for the elaboration.
This might be an answer for the single page rotation/deletion.
How can I send a certain signature (by "addition signature" function) or any other annotation added to The XOD?

Thanks,
Lior.

Matt Parizeau

unread,
Oct 21, 2016, 2:15:00 PM10/21/16
to PDFTron WebViewer
Hi Lior,

You can keep your annotations in XFDF format, separate from the PDF and XOD, and just load them into the viewer when loading a document. See this tutorial for more information on how this works https://www.pdftron.com/webviewer/demo/tutorials/getting-started-annotations.html

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Lior Sapir

unread,
Oct 24, 2016, 12:51:59 PM10/24/16
to PDFTron WebViewer
Hello,

Thank you for the answer.
Assasin for the relevant PDF, how can I eventually save over the PDF file the annotation/signature? The PDF is the file I should be able to use in order to send via email and etc..

I'd appreciate your answer.

Thanks,
Lior.
Message has been deleted

Matt Parizeau

unread,
Oct 26, 2016, 5:51:16 PM10/26/16
to PDFTron WebViewer
Hi Lior,

I'm not sure I understand your question. If you want to merge the annotations into the PDF you can use PDFNet to do that. See here for some sample code on how to merge XFDF into a PDF using PDFNet https://www.pdftron.com/pdfnet/samplecode/FDFTest.cs.html

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