cancel
Showing results for 
Search instead for 
Did you mean: 

AddPage not appending images to the end of a document?

Brian_Bartolazo
Confirmed Champ
Confirmed Champ

Hello,

I'm having trouble with getting the AddPage functionality within the API to add the page to the end of the document. I have a one page TIF image, but whenever additional TIFs are appended through the API, it adds them before the initial page, so that the initial page is always the last page of the document.

I am executing the Unity script via workflow (IWorkflowScript).

I also reverted the code in the script to the very basic code as described in the SDK:

Document d = args.Document;
Imaging imaging = d.Imaging;
imaging.AddPage(@"C:\append.tif",2);

According to the SDK:

Execute the AddPage method. This method will need either the page data or the file path for the pages to be added and the index for where in the document the page will be inserted. The new page will be inserted before the page specified by this index.

According to the help within OnBase Studio in regards to the InsertBeforePage parameter (version 14):

If this value is less than or equal to 1 then the page is inserted at the beginning.
If this value is greater than the count then the page is inserted at the end.

The Workflow action finds the Related Document (the initial single page tif) and runs the script against it. I've tried it numerous different ways (different parameters for the InsertBeforePage IE: 2, 3, 100), all of which always add the new pages to the top and push the inital page to the end.

Is there anything else that needs to be addressed? Perhaps on the Document Type level or something like that? The script appends the documents that we expect them to, it's just this problem of not adding them to the end.

Thanks,

Brian

1 ACCEPTED ANSWER

Rob_Herman
Star Contributor
Star Contributor

Good afternoon,


It looks like the problem you are experiencing is a known bug. It was written up as SCR #213605, and has been fixed in OnBase 14.0.2 as well as OnBase 15 and later.

--|Rob

View answer in original post

2 REPLIES 2

Rob_Herman
Star Contributor
Star Contributor

Good afternoon,


It looks like the problem you are experiencing is a known bug. It was written up as SCR #213605, and has been fixed in OnBase 14.0.2 as well as OnBase 15 and later.

--|Rob

Appreciate the info Rob, we probably won't be able to update to a fixed version before this workflow goes into Production but I have come up with a workaround to resolve this for now.

Thanks!