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

Question

Question

SDK not recognizing Landscape

asked on February 16, 2023

We notice cases where Laserfiche SDK does not retrieve the dimensions of landscape vs. portrait document page images correctly. The SDK reports a different dimension from what is exposed in the bottom right of the client image pane.

Page 1 is portrait, page 2 is landscape with annotations that we need to update with the SDK.

LF SDK thinks all Order Sheets from page 2 down are not landscape.

Here are some notes from the log where the SDK is trying to get page dimensions and find annotatations.

02/15/23 13:15:41 : LF Start Page = 2, Number of Pages = 1

02/15/23 13:15:41 : LF Page Index = 2

02/15/23 13:15:41 : After Get Page, height = 3300, width = 2550

02/15/23 13:15:41 : Corey - Temp Logging - PCMS Page Dimension Check Invalid

02/15/23 13:15:41 : After bids.Add

02/15/23 13:15:41 : Annotation Key = Patient ID:

02/15/23 13:15:41 : Annotation Id = -1

02/15/23 13:15:41 : Annotation Key = UPIN:

02/15/23 13:15:41 : Annotation Id = -1

02/15/23 13:15:41 : Annotation Key = Sales Order:

02/15/23 13:15:41 : Annotation Id = -1

 

Has anyone experienced this before?

0 0

Replies

replied on February 16, 2023

Have you checked the rotation property of the page? When you rotate a page, the image itself is not modified in any way, it just marks the page as rotated. So if it was rotated 90 or 270 degrees, you would need to swap height and width.

0 0
replied on February 21, 2023

I tracked the page in the LF Server Volume and the .tiff file contradicts the height and width the SDK is reporting. I dont think rotation has to do with it. We work with many mixed portrait and landscape images and never had any issues like this. Also, it would be more consistent, as we take in hundreds of documents a day with mixed page orientation and this seems to happen to an odd case once a week or so. Here is a screenshot of the properties:

0 0
replied on February 22, 2023

So do you think something is being recorded incorrectly at the time of capture?

0 0
replied on March 9, 2023

Brian, Here are the answers to some of the follow-up questions from this post: 

Q: So do you think something is being recorded incorrectly at the time of capture? - A: We create hundreds of these documents via SDK call, no scan or other capture method. It's just documents with the strange extra line that consistently have dimension read wrong.

Q: How well does that observed difference correlate to instances of the problem? - As far as we can tell the error in dimension is consistent with the extra space "knock-on" effect, from original screenshot of document image.

Q: Does the problem exist with all rotated pages? - Only when the extra space occurs in the actual rendering of the PDF, however, when the dimension is off for a single page, all other following pages are also off.

Here is a code snippet where ordLF is the entry object:

 

                    if (ordLF != null)
                    {
                        for (int index = startIndex; (index <= ordLF.Pages.Count) && (index < startIndex + custPages); index++)
                        {
                            Support.LogIt("LF Page Index = " + index.ToString());
                            LFPage page = ordLF.Pages.get_Item(index);
                            Support.LogIt("After Get Page, height = " + page.Image.Height.ToString() + ", width = " + page.Image.Width.ToString());
                            if (page.Image.Height > page.Image.Width)
                            {
                                if (orderingSystemSource == "AMTMetrics")
                                {
                                    continue;
                                }
                                Support.LogIt("Corey - Temp Logging - PCMS Page Dimension Check Invalid");
                            }
                            bids.Add(index, "");
                            Support.LogIt("After bids.Add");
                            foreach (string key in lfData.Keys)
                            {
                                Support.LogIt("Annotation Key = " + key);
                                int aid = Program.findTextboxAnnotation(page, key);
                                Support.LogIt("Annotation Id = " + aid.ToString());
                                if (aid > 0)
                                {
                                    lfSingle.Rows.Add(aid.ToString(), key, lfData[key], ordLF.ID.ToString(),
                                        index.ToString(), ordLF.Pages.Count.ToString());
                                }
                            }
                        }
                    }
0 0
replied on March 9, 2023 Show version history

I'm not sure where we are now - whether you think you've found a bug in a piece of Laserfiche software, or if you are trying to track down a bug in your own code. In either case, it would be helpful to have a minimal and complete example that reproduces the problem, with a clear statement of why you think it's doing the wrong thing. If you think it's a bug in LF, you could attach it to a support case.

One thing that jumps out at me is `page.Image.Height > page.Image.Width`, which implies that your program is intended to behave differently depending on the page orientation.

0 0
replied on February 22, 2023

One user mentioned that they think this is due to first page having 2 lines on a patient name, but it does seem that something is captured incorrectly:

0 0
replied on February 23, 2023

It might be possible if there are knock-on effects from that, like the page needing to be larger, or causing the document to spill onto another page or something. It also depends on your capture method, which I don't think you've said if this is scanning or Snapshot or what. But if that difference is limited to what pixels are within an otherwise identical page, it's hard to see how it would cause the problem you are seeing. All that said, the obvious follow-up question is: how well does that observed difference correlate to instances of the problem?

0 0
replied on February 24, 2023

Can you provide the code showing how you are retrieving the page/image dimension?

 

Does the problem exist with all rotated pages?

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

Sign in to reply to this post.