You are viewing limited content. For full access, please sign in.

Question

Question

LF SDK - exportpdf not success with LF document has no pages information

asked on January 11, 2017

Hi I am doing a small project that export LF document as PDF with SDK script.

The code is simple like this:

            DocumentInfo DI = Document.GetDocumentInfo(this.BoundEntryInfo.Id, RASession);
            DocumentExporter DE = new DocumentExporter();
            DE.ExportPdf(DI, DI.AllPages, PdfExportOptions.None, "C:\\temp\\" + DI.Name + ".pdf");

It works fine when DI.AllPages returns valid content. However, if the document doesn't have pages, then DI.AllPages returns a NULL object which fails the function.

However, it happens many chances the LF document is valid TIFF or PDF or other format but just don't have LF pages information in it. I am wondering in this situation, how should I do to correctly export the document into a PDF?


 

 

0 0

Answer

SELECTED ANSWER
replied on January 12, 2017

Right, "pages" in Laserfiche refers to image (or text pages). That's because traditionally, Laserfiche stored images and those are stored as single-page images for more efficient retrieval. ExportPDF converts those image pages into a PDF on export.

Pages in the electronic document don't have any meaning in Laserfiche, the electronic document is viewed as a single component of the document. There are no format conversion option when exporting the electronic document.

0 0

Replies

replied on January 11, 2017

DocumentExporter.ExportPDF exports image pages as a PDF, it does not export the electronic component of a document. And it sounds like your document does not have image pages.

You want to use DocumentExporter.ExportElecDoc to export the electronic document.

1 0
replied on January 12, 2017

Thanks for the answer.

I think the confusing about "pages" here are SDK functions are looking for Laserfiche Pages not general concept of document pages -- i.e. you can open those PDF out of LF and it does shows pages.

The document that shows no pages in LF client are those import by other processes which may bypass the "generate laserfiche pages" step. To fix "no pages" I can select and click "Generate Pages".

Anyway, I will try using DocumentExporter.ExportElecDoc if I detect there are no LF pages in that document.

0 0
SELECTED ANSWER
replied on January 12, 2017

Right, "pages" in Laserfiche refers to image (or text pages). That's because traditionally, Laserfiche stored images and those are stored as single-page images for more efficient retrieval. ExportPDF converts those image pages into a PDF on export.

Pages in the electronic document don't have any meaning in Laserfiche, the electronic document is viewed as a single component of the document. There are no format conversion option when exporting the electronic document.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.