Skip Menu |

This queue is for tickets about the PDF-API2 CPAN distribution.

Report information
The Basics
Id: 98535
Status: rejected
Priority: 0/
Queue: PDF-API2

People
Owner: Nobody in particular
Requestors: philperry [...] hvc.rr.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: nl(width) not working
Date: Tue, 02 Sep 2014 10:43:08 -0400
To: bug-PDF-API2 [...] rt.cpan.org
From: Phil M Perry <philperry [...] hvc.rr.com>
PDF::API2 v2.022 Perl 5.16.3 Windows 7 severity: Important From reading the POD and following the code, it appears that the intent of the nl($width) method is to go down to the next line ($self->lead points decrease y) and then indent by $width points. It appears to ignore $width. Thus, nl(width) = nl() = nl(0) = cr(), all of which produce the PDF command T* . I suggest that the code be changed to produce (when $width given) $width $self->lead Td. This should not only go down to the next line (T*), but also move right (+x) by $width, which appears to be the intent of the method. I have not changed Content.pm or its POD yet.
Subject: [rt.cpan.org #98535]
Date: Sun, 24 Jan 2016 16:23:30 -0500
To: bug-PDF-API2 [...] rt.cpan.org
From: Phil M Perry <philperry [...] hvc.rr.com>
Can anyone comment on whether I'm reading nl() correctly, and if my proposal is correct and won't break existing code? Thanks. Incidentally, a negative $width should produce an "outdent" (hanging first line). I don't know why there are both nl() and cr() calls, as they do largely the same thing (see bug 98550). Perhaps any extension to functionality should be for one, and the other deprecated? The basic idea in both is to go down one line (OBJ->lead) and then adjust vertically (cr) or horizontally (nl). A good extension would be to go down or up some integral number of lines (lead value) and allow both vertical and horizontal (indent/outdent) adjustments. Something to keep track of going below the bottom margin and force a new page might also be useful. Thoughts from the community? To add a comment to this thread, just email bug-PDF-API2 [at] rt.cpan.org with subject line [rt.cpan.org #98535]. Note 1 space between org and #, and the [ ] around the whole subject. Nothing else. If you don't follow this format carefully, you will end up creating a new bug report! HTML formatting within the body of the comment does not work.
$width is (was) an undocumented option to nl() that does (did) nothing. I've removed it. There's a separate command (distance) that can handle adding a newline, carriage return, and indent all at once.
Subject: [rt.cpan.org #98535]
Date: Thu, 18 Feb 2016 14:49:32 -0500
To: bug-PDF-API2 [...] rt.cpan.org
From: Phil M Perry <philperry [...] hvc.rr.com>
How about the following POD entry? The alternative would be to restore, fix, and document the $width parameter. Or, given the distance() method, consider deprecating both cr() and nl(). Come to think of it, "distance" is a non-intuitive name for that method. Maybe it too should be deprecated and renamed crlf(deltaX, deltaY) or nextline(deltaX, deltaY)? They would be much more obvious. =item $content->nl() Moves to the start of the next line (carriage return, then down by current leading amount). It is equivalent to C<cr()>. Use the C<distance()> method if you wish to go to the next line and adjust the position by horizontal and/or vertical amounts.