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

Question

Question

SDK import tiff pages

asked on February 2, 2022

I'm trying to import a TIF image as a native document.  The entire document gets uploaded, but only the first page is viewable.  In looking at the files, it seems that I need to break the original document into pages, and import each one separately.  Is there a way to do this automatically?  If not, what is the best way to identify the page breaks within the raw TIF data?

Here is the code I'm using:

Dim myImage As Byte() = File.ReadAllBytes(zFilename)
Dim myPageInfo As PageInfo = myDocumentInfo.AppendPage
Dim myPageStream As Stream = myPageInfo.WritePagePart(PagePart.Image, myImage.Length)
myPageStream.Write(myImage, 0, myImage.Length)
myPageStream.Dispose()
myPageInfo.Save()

 

0 0

Answer

SELECTED ANSWER
replied on February 2, 2022

I think `DocumentImport.ImportImages()` will do what you want.

1 0

Replies

replied on February 2, 2022

The DocumentImporter class should be able to handle all of that for you.

1 0
replied on February 2, 2022

I'm using DocumentImporter to import Electronic Documents.  However, the user needs for TIFF to be imported as Native documents, so that they can make use of the built-in viewer, annotation, etc.

0 0
SELECTED ANSWER
replied on February 2, 2022

I think `DocumentImport.ImportImages()` will do what you want.

1 0
replied on February 2, 2022

@████████that is what I was looking for!  I'd been using DocumentImporter.ImportEdoc for non-native documents, but it was the ImportImages for native documents that I was missing.  I had found that chunk of code I was using in another topic here, and that lead me down the wrong road.

Thanks for the assistance!

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

Sign in to reply to this post.