Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when page count do not match with sample document #12

Open
tomas-lakatos opened this issue Oct 27, 2023 · 1 comment
Open

Issue when page count do not match with sample document #12

tomas-lakatos opened this issue Oct 27, 2023 · 1 comment

Comments

@tomas-lakatos
Copy link

tomas-lakatos commented Oct 27, 2023

Hello,

Our client has found a problem. They erronously scanned less pages, than the document normally contains. This results in multiple runtime errors, for example when trying to move zones on the page that does not exist.

The examples of my fixes:

Private Sub SL_CalculatePageShift_LocateAlternatives(ByVal pXDoc As CASCADELib.CscXDocument, ByVal pLocator As CASCADELib.CscXDocField)
...
         'ZonesExist(AZLDef.Zones(Z).PageNr)=True
         If AZLDef.Zones(Z).PageNr <= pXDoc.Pages.Count-1 Then 'TLA
            ZonesExist(AZLDef.Zones(Z).PageNr)=True
         End If 'TLA


Public Sub Zones_Shift(AZLZones As CscAdvZoneLocZones, Shifts As CscXDocFieldAlternatives, Rep As CscXDocRepresentation)
...
      If (AZLZones(Z).PageNr <= Rep.Pages.Count - 1) Then 'TLA
         Set XDocZone=Zone_Shift(AZLZones(Z),Shifts,Rep)
         Rep.Zones.Append(XDocZone)
      End If 'TLA

If I find more issues with this script because of the incorrect number of scanned pages, I'll try to update.

@tomas-lakatos
Copy link
Author

Only further issue was the method for extracting the AZL zones with the already present OCR without doing it again (to save Clarity licences but keep the OCR quality). This of course also failed for locators on non-existent pages. It was enough to add the check.
If SubFields(S).PageIndex > 0 Then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant