Bug 14894 - Labels: allow empty lines in PDF export
Summary: Labels: allow empty lines in PDF export
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: 3.20
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Chris Nighswonger
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-25 07:42 UTC by Theodoros Theodoropoulos
Modified: 2015-09-28 12:36 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Theodoros Theodoropoulos 2015-09-25 07:42:29 UTC
When creating a label layout with en empty string ('') in the fields to print, this line is stripped in the PDF export. The same happens with spaces ('   ') and non printable characters (tab, vtab, etc).

The CSV and XML outputs are working properly and display all strings, regradless if they are empty, contain spaces or non-printable characters. Only the PDF output (which is VERY important) is affected.

The reason behind this request -apart from keeping a consistency between the various export formats- is to be able to enter empty lines in the actual spine label. This should be fairly easy to fix, and seems to be mostly related to the PDF creator code.
Comment 1 Theodoros Theodoropoulos 2015-09-25 07:48:42 UTC
FYI, there are two 'suspicious' line in the Label.pm code:
201: $f =~ s/^\s?//;
456: next LABEL_LINES if $line eq '';

that could be relevant to this issue, but even if they are commented out, the PDF output remains the same. Maybe additional changes should be made to the PDF creator.
Comment 2 Chris Nighswonger 2015-09-25 12:27:36 UTC
At present this is by design. I'd like to hear feedback from the koha user's list before removing it. We could also consider making it an option set in the layout.
Comment 3 Theodoros Theodoropoulos 2015-09-28 08:43:28 UTC
I find it difficult to understand why PDF creator should by default strip empty lines of text (I suppose there is a good reason for that), but even so, it is a bit confusing to the users because CSV and XML outputs follow a different approach and display empty lines and spaces.

I don't know what the community thinks about this request, but my humble opinion would be not to overlook it and to -at least- have an option in the layout screen to not strip empty lines of text in PDF!

An alternative idea (that does not involve changes to the layout screen) would be to strip empty lines -by default- when these are results of MARC fields -as you do now-, but display them when they are simple text (in single quotes)...
Comment 4 Chris Nighswonger 2015-09-28 12:36:51 UTC
(In reply to Theodoros Theodoropoulos from comment #3)

> An alternative idea (that does not involve changes to the layout screen)
> would be to strip empty lines -by default- when these are results of MARC
> fields -as you do now-, but display them when they are simple text (in
> single quotes)...

As I recall the problem was that imported MARC records tend to have various fields which include spaces/non-print chars but no data for whatever reason (probably due to sloppy data entry or messed up MARC editors, etc.). It was not readily obvious that empty fields contained spaces, etc., so the easiest approach was to strip all blank fields when creating labels. This is the first time I recall it being a problem, however, I think that adding a switch for this to the layout screen is a very good approach to resolving it.

It should be fairly straightforward to do this. Personally, I cannot commit to doing it any time soon, but perhaps someone else might be able to.