ExLibrisGroup / SpineOMatic

Spine label printing for Ex Libris' Alma
MIT License
35 stars 18 forks source link

Unhandled Exception on Print Preview #70

Closed SSWinger closed 1 month ago

SSWinger commented 1 month ago

I have had no issues printing labels until today, when I went to print preview I received this message

image Unhandled exception has occurred in your application.

I uninstalled and reinstalled the program and still having the issue.

mgobat commented 1 month ago

@SSWinger, could you copy the contents of the batch labels box and include it in a comment on the issue? Thank you.

SSWinger commented 1 month ago

JUV HQ 76.5 .S74 2024 HQ Stevenson, Robin, 76.5 Queer history A to Z : 100 .S74 years of LGBTQ+ activism 2024

GAMES GV 1469.62 .W57 G75 2024 GV Kurt Griesemer 1469.62 Wisconsin Adventures: Myths .W57 & Legends G75 2024

PS PS 3601 .L92 S35 2018 3601 Alyan, Hala, .L92 Salt houses S35 2018

PK PK 6908.9 .E35 D5913 2023 6908.9 ʻElî, Bextiyar, .E35 The last pomegranate tree D5913
2023

PR PR 9199.4 .B448 C64 2024 9199.4 Belcourt, Billy-Ray, .B448 Coexistence : stories C64 2024

PL PL 2953 .R43 Z44 2023 n.2 2953 Priest, .R43 Guardian : zhen hun. Z44 2023
n.2

PL PL 2953 .R43 Z44 2023 n.1 2953 Priest, .R43 Guardian : zhen hun. Z44 2023
n.1

PS PS 3601 .B86 A67 2021 3601 Abulhawa, Susan, .B86 Against the loveless world A67 : a novel 2021

HQ HQ 77.8 .D54 A3 2024 77.8 DiFrancesco, Alex, .D54 Breaking the curse : a A3 memoir of trauma, healing, 2024

KF KF 245 .B58 2020 245 Harvard Law Review .B58 Association, 2020 The bluebook : a uniform system of citation

PJ PJ 7630 .A312 T75 2024 7630 Rafīdī, Wisām, .A312 The trinity of fundamentals T75 2024

HV HV 1552.3 .A36 2021 1552.3 Catapano, Peter .A36 About Us : Essays from the 2021 Disability Series of the

mgobat commented 1 month ago

Thank you, @SSWinger. Could you also attach screenshots of your "Print Setup" and "Call Number Format" tabs?

SSWinger commented 1 month ago

image image image

Like I said, this worked fine yesterday, went to print my labels this morning and error.

mgobat commented 1 month ago

@SSWinger, I haven't been able to replicate the problem yet. The screenshot you provided for the "Print Setup" tab indicates "Pocket Labels", but the screenshot for "Call Number Format" indicates spine labels. If you are trying to print pocket labels, please provide a screenshot of the "Call Number Format" tab with "Pocket Labels" checked.

I also don't have the same printer, so that could be part of why I can't replicate. If you have "Microsoft Print to PDF" as an option when you click the "..." button next to the "Printer:" field on the "Print Setup" tab, could you try using that printer to see if the problem still happens? If it does not happen, then we know the printer is the problem in some capacity. Thanks.

SSWinger commented 1 month ago

image

I was having no issues printing until yesterday, nothing changed that I know of.

I tried the Microsoft Print to PDF and I am still getting the same issue.

Here are details to the error: See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

** Exception Text ** System.ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at SpineLabeler.Form1.removePocket(Array line) at SpineLabeler.Form1.PrintDocument2_PrintPage(Object sender, PrintPageEventArgs e) at System.Drawing.Printing.PrintDocument.OnPrintPage(PrintPageEventArgs e) at System.Drawing.Printing.PrintController.PrintLoop(PrintDocument document) at System.Drawing.Printing.PrintController.Print(PrintDocument document) at System.Drawing.Printing.PrintDocument.Print() at System.Windows.Forms.PrintPreviewDialog.OnprintToolStripButtonClick(Object sender, EventArgs e) at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

** Loaded Assemblies ** mscorlib

mgobat commented 1 month ago

@SSWinger, though the detailed error message provides some insight, I'm still not able to replicate. The error indicates that the problem happens when the program is trying to separate a spine label from its pocket label.

Does it happen even if only one label set is in the batch? If not, how many labels need to be in the batch to create the error? Thanks.

SSWinger commented 1 month ago

I went through the labels and it seems to get hung up on a title that had been translated, and I think some of the letters are causing the issue. I if I do all but that label the program is fine. This is the one I had the issue with: PK PK 6908.9 .E35 D5913 2023 6908.9 ʻElî, Bextiyar, .E35 The last pomegranate tree D5913 2023

mgobat commented 1 month ago

Great detective work, @SSWinger! I'll create (or find) a similar title in our test environment to try to replicate and repair.

mgobat commented 1 month ago

@SSWinger, the problems seems to occur only when certain characters are the first character in a line on a pocket label. Please try release 8.1.3.

https://github.com/ExLibrisGroup/SpineOMatic/releases/download/v8.1.3/SpineLabeler.exe

Thank you.