asked on May 21

I have a task to get some of our images (the TIF files) out of the hex folder structure and into some other places for use in our application. I have been trying to use this library: https://developer.laserfiche.com/lf-api-js/modules.html

It seems that I can't figure out a way to do this self-hosted. 

"Can the Self Hosted Laserfiche API download images?" (dated Nov 2022, updated Aug 2024) 

A Laserfiche employee states:

"Hi, if the entry is a "Document" type with an image component, then the Self Hosted API Server isn't able to download the image. If the entry is an image type like "PNG Image" or "JPEG Image", then it should be able to download the image."

And critically: "Also, currently the Self Hosted API Server only has the v1 API version."

They also mention: "We are looking into adding this feature in the future to be able to download the image component from an electronic document." (This refers to a "Document" type entry that has scanned pages, i.e., isElectronicDocument: false).

Another user in that thread mentions the v2-alpha API (which is for Laserfiche Cloud) can export pages via:

https://api.laserfiche.com/repository/v2-alpha/Repositories/{repoId}/Entries/{entryId}/Export?part=Pages&format=Tiff

This endpoint for v2-alpha returns a JSON with a download URL.

This strongly implies:

  1. The current self-hosted API does not support directly downloading images/pages of a "Document" type entry where isElectronicDocument: false through the exportDocument method we've been trying. 
  1. The V2 client library's exportDocument method, when talking to a self-hosted V1 endpoint, likely can't magically provide this functionality if the underlying V1 API doesn't expose it in that way.
  1. The part=Pages parameter for exportDocument seems to be a V2 (Cloud/v2-alpha) feature that returns a download link, not a direct stream in the response body.

 

To get the page_id or the physical path for scanned documents we cannot rely on entriesClient.exportDocument() as we've used it so far. The self-hosted V1 API, which our setup uses, doesn't seem to provide the image stream or a download link via this method for non-electronic "Document" entries.

 

Can someone steer me to a viable alternative for a self-hosted, 10.4 instance, so I am able to grab these documents in some form or another? I believe they are mostly collections of pdfs in a single doc. Thanks in advance. 

0 0