In a standalone app using the Laserfiche SDK I am trying to generate image pages for a number of pdfs that are in LF Cloud, so we can generate OCR text. I first tested my code in a local Laserfiche repository and it works fine. When I try to point to a Laserfiche Cloud repository with copies of the same documents hosted there, I get an error on the ImportImages command: "The parameter is incorrect [-2147024809]"
Here is the code I am executing. I am leaving out the pdf extraction portion for brevity - the same code works in an on-prem repository.
try
{
TIFStream.Position = 0;
DocumentImporter docImporter = new DocumentImporter();
docImporter.Document = Doc;
docImporter.ImportImages(TIFStream); << Errors here
Logging.WriteLogFile($"Successfully imported pages for Doc ID {LFDocID}.");
}
catch (Exception ex)
{
Logging.WriteLogFile($"Error importing TIFF into Laserfiche: {ex.Message}");
return -1;
}
I also get the same error when I try generating pages through the Laserfiche Client going against LF Cloud. Maybe LFCloud does not support this SDK function?
Question
Question
DocumentImporter.importimages - the parameter is incorrect in LF Cloud
Replies
When you log into cloud through your SDK application, are you setting it to use SSL? I have found that with cloud, an SDK script can log in without SSL, but not everything works.
What is the stack trace of the exception? That should shed some light on what sub-step is failing. For instance, it could be complaining about the volume that you are instructing it to create the document on.
Here is the stack trace and thank you!
at Laserfiche.RepositoryAccess.LaserficheWriteStream.FinishWrite()
at Laserfiche.RepositoryAccess.LaserficheWriteStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at Laserfiche.DocumentServices.DocumentImporter.WriteRawImage(Stream imageStream, Int32 size, PageInfo page)
at Laserfiche.DocumentServices.DocumentImporter.InternalImportImages(Stream imageStream, PageRange pagesToImport)
at Laserfiche.DocumentServices.DocumentImporter.ImportImages(Stream imageStream)
at Generate_LF_Pages.LaserficheFunctionsRA.GeneratePagesForPDF(Int32 LFDocID) in D:\Repos\LASERFICHE UTIL\Generate Pages\Generate LF Pages\LaserficheFunctionsRA.cs:line 2184
My SDK DLL references point to:
C:\Program Files\Laserfiche\SDK 10.4\bin\10.4\net-4.0\Laserfiche.RepositoryAccess.dll
C:\Program Files\Laserfiche\SDK 10.4\bin\10.4\net-4.0\Laserfiche.DocumentServices.dll
File size (stream size): 2,504,248 bytes