Document preprocess on upload

66 views
Skip to first unread message

Dexter

unread,
Jul 26, 2018, 6:14:41 AM7/26/18
to Mayan EDMS
Hi All,

Is it possible to perform a preprocess on uploaded document ?

The idea is that we would like the sources of the documents to be uploaded ( for example LaTeX files and projects), and make Mayan run the compiler and generate a PDF. This PDF will be what is shown in the preview.

Without this we must upload the PDF version, and find another system to store the sources. We don't like the idea of using two tools to store documents

Thanks

Roberto Rosario

unread,
Aug 8, 2018, 5:39:44 PM8/8/18
to Mayan EDMS
This is an interesting concept. Since Mayan was originally made to be used in government and legal setting, one of the philosophies was to keep the uploaded document intact. This is to preserve the chain of evidence. 

In this case the possible solution we've come up with is to add new workflow actions to create a new document (PDF) based on a previously uploaded document (LaTex one) and then delete the previous document. This way there is a log of how the PDF was created and the upload process doesn't need to be customized. For this three workflow actions need to be created: A document delete action, one to call an external binary and another to the upload a new file as a document.

More discussion is needed but just letting you know how far we are in the brainstorm.

Dexter

unread,
Aug 8, 2018, 6:07:12 PM8/8/18
to Mayan EDMS
Thanks. Your idea seem to do the what is expected but has the following major drawbacks:
- Creating a new doc will destroy the link between the "source" and the created PDF
- By deleting the original document, we can no longer have access to the source. This is problematic for the review process: in order to change the document, we need to download the source, modify it and upload a new version in source form. As the link between source and PDF is lost, the newly created PDF from the modified source will not be a new PDF version but a new document

What I was thinking of is much simpler: You're generating pictures from uploaded documents for the preview. In fact, you upload a PDF and preview pictures of pages. This time you would upload a LaTeX and still preview pictures. You just need to recognize that this is a LaTeX document and run the generator locally. This will either be hardcoded in the source (like now for PDFs, OO documents, ...) or offer a mean of launching PDF generators for unknown types.

Thanks

Roberto Rosario

unread,
Aug 15, 2018, 4:39:25 PM8/15/18
to Mayan EDMS
I understand better now. It would just be a case of adding support for previewing LaTeX files in the converter app. Can you provide some sample LaTeX files (no confidential or private information) or point to links of LaTeX used for testing rendering software? A list of software or command used for generating PDFs out of LaTeX files will be useful too as we don't have experience with LaTeX files.

Dexter

unread,
Aug 16, 2018, 3:39:28 AM8/16/18
to Mayan EDMS
Hi,

LaTeX was just an example. I have in mind ReST documents to be processed by the SPHINX build system.

You can go to https://github.com/DexterMagnific/QSvgStyle, clone the repository and build the doc/ directory by typing 'make latexpdf'
In this example, we would upload the whole doc/ directory to MAYAN (compressed, for example: doc.sphinx.zip). MAYAN would recognize the sphinx.zip extension and perform local generation of the PDF. Then you would follow the standard picture generation from PDF.

Thanks


On Thursday, July 26, 2018 at 12:14:41 PM UTC+2, Dexter wrote:
Reply all
Reply to author
Forward
0 new messages