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

Question

Question

its possible delete image of page of properties document from SDK laserfiche ?

asked on January 16, 2014

Hi

I have a document in Laserfiche. For example: a document with 3 pages. This properties document

is: 

 

Pagina             Path Image                       Size                 Path Text

1                       00\00\0D\00000D6C      418390             ********

2                       00\00\0D\00000D6D      408175             ********

3                       00\00\0D\00000D6E      420294             ********

 

Total                                                            1.19MB

 

Its posible delete the images associated with document via SDK laserfiche ?

what class library, i use ?

 

thanks.

 

 

 

Propiedades.png
Propiedades.png (34.01 KB)
0 0

Answer

SELECTED ANSWER
replied on January 16, 2014 Show version history

I would suggest using the Repository Access (RA) library instead of the older LFSO library.  Here is a code snippet to delete a single page (image) in a document using RA;

        'Best practice to wrap the code in a Try/Catch block just in case there is an error thrown...
        Try

            'Using RA start with a RepositoryRegistration object.  
            'First parameter is the LF servername, second parameter is the repository name...
            Dim myRegistration As New RepositoryRegistration("localhost", "LFMAIN")
            Dim mySession As New Session

            'With the session object call the login method with the UserID, password, and registration object.
            'NOTE: To use Windows Authentication to login to LF use this syntax: mySession.Login(myRegistration)
            mySession.LogIn("admin", "admin", myRegistration)

            'Instantiate a DocumentInfo object with the entryID of the document to work with...
            Dim docInfo As DocumentInfo = Document.GetDocumentInfo(92732, mySession)

            'Lock the DocumentInfo object in preparation for deleting a page...
            docInfo.Lock(LockType.Exclusive)

            'Delete the page...
            'NOTE: The DeletePage method will accept a single page number to delete or a PageSet to delete if you want to 
            'delete a series of pages with a single call...
            'NOTE: The pagenumber in RA is not 0 based but is 1 based, so delete page 1...
            docInfo.DeletePage(1)

            'Unlock the DocumentInfo object...
            docInfo.Unlock()

            'Cleanup...
            docInfo.Dispose()
            mySession.Close()
            mySession = Nothing
            myRegistration = Nothing

        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK)

        End Try

Let me know if that answers your question...

2 0

Replies

replied on January 17, 2014

Very thanks

Cliff Primmer

 

but, to remove page 1, delete image file and txt file of page 1. Only remove image file for page 1, but not txt file.

 

for example :

 

previous

Pagina             Path Image                                Size                 Path Text                                    Size

1                       00\00\0D\00000D6C.TIFF      418390             00\00\0D\00000D6C.TXT     3444 

2                       00\00\0D\00000D6D.TIFF      408175             00\00\0D\00000D6D.TXT     3652

3                       00\00\0D\00000D6E.TIFF      420294             00\00\0D\00000D6E.TXT      4864 

 

next (delete page 1,2,3  only image file , but not txt files)

 

Pagina              Path Text                                    Size

1                  00\00\0D\00000D6C.TXT     3444 

2                  00\00\0D\00000D6D.TXT     3652

3                  00\00\0D\00000D6E.TXT      4864 

 

Its posible via library laserfiche (Sdk, Repository Access, etc)

thanks for the help

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

Sign in to reply to this post.