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

Question

Question

Extension not saved after writeEDoc() and setExtension()

SDK
asked on July 27, 2016

Similar to https://answers.laserfiche.com/questions/99991/File-contents-not-saved-after-writeEDoc-using-Java-JRA-SDK but a bit more narrow.

Originally, when we added documents to Laserfiche via JRA, we were concerned because the pages were blank. I'm realizing now that this is because when we use JRA, the 'Generate Pages' functionally cannot be automatically run. So uploading a PDF document results via JRA results in a new correct electronic document but the pages cannot be viewed within the Laserfiche client.

However, I am still confused. When I add a document to our Laserfiche repo via the JRA SDK, the icon shows as a generic file and the file extension in properties is blank. The file can be opened in Adobe Reader, and the document type in properties is 'application/pdf'.

I can manually import the same PDF file and it shows up correctly and with the correct file extension. See the attached screenshot for an example

 

In our JRA code, I try running setExtension('pdf') before and after the writeEDoc() call, but there is no change. What could I be missing?

laserfiche-jra-no-extension.png
0 0

Replies

replied on July 27, 2016

May have solved it...

myDoc.setExtension("pdf");
myDoc.writeEDoc(...);

myDoc.unlock();
myDoc.save();

Just the right order of setExtension(), write, unlock() and save()...

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

Sign in to reply to this post.