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

Question

Question

exporting specific page with weblink using 9.2 libraries

asked on February 20, 2018

I am trying to modify a customer's code to export specific pages of a document to a byte array.  I have a document with two pages, and to try to export the second page, I do the following:

            ILFConnection lfConnection = m_Conn.Database.CurrentConnection;
            DocumentExporter documentExporter = new DocumentExporterClass();
            ILFEntry lfEntry =m_Conn.GetEntryFromCache(laserficheObject.EntryID, false);
            LFDocument lfDocument = (LFDocument)lfEntry;
            LFDocumentPages lfDocPages = lfDocument.Pages;
            lfDocPages.MarkPage(lfDocPages.Item[1]);
            documentExporter.AddSourcePages(lfDocPages.Item[1]);
            documentExporter.Format = Document_Format.DOCUMENT_FORMAT_JPEG;
            //documentExporter.VerifyImageChecksum = true;
            byte[] bytes = (byte[])documentExporter.Export();

But I still get only page 1!  By marking page[1] and adding that as source page for the exporter, shouldn't I be getting page 2 exported (assuming this is zero indexed and page 1 is Item[0] and page 2 is Item[1]).

0 0

Replies

replied on February 20, 2018

I think the pages collection uses 1-based indexing.  Did you try that?

0 0
replied on February 20, 2018

Looking through the SDK documentation, I'm pretty sure pages are 1-based, not 0-based.

Also, I'm not sure what this has to do with WebLink. 

0 0
replied on February 20, 2018

1 indexed?  Yuck!  So what is Item[0]?  But I am a newb, so maybe there is good reason.  I will try with item[2], but fully expect an index-out-of-range exception.

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

Sign in to reply to this post.