PhilterPaper / Perl-PDF-Builder

Extended version of the popular PDF::API2 Perl-based PDF library for creating, reading, and modifying PDF documents
https://www.catskilltech.com/FreeSW/product/PDF%2DBuilder/title/PDF%3A%3ABuilder/freeSW_full
Other
6 stars 7 forks source link

[RT 98576] General notes on testing Content.pm #24

Closed PhilterPaper closed 7 years ago

PhilterPaper commented 7 years ago

Subject: General notes on testing Content.pm Date: Tue, 2 Sep 2014 21:47:40 -0400 To: bug-PDF-API2 [...] rt.cpan.org From: Phil M Perry

PDF::API2 v2.022 Perl 5.16.3 Windows 7 Severity: Normal

While testing, updating, and documenting Content.pm and some related components, I encountered some issues that should be thought about:

# Wed Feb 17 18:27:11 2016 steve [...] deefs.net - Correspondence added

There are too many items here for one ticket, so I'm closing it.

If spline is poorly named (I'm not knowledgeable in this area), it can be deprecated and replaced by a better-named function. Please provide documentation and a suggestion for a new name for the existing function.

Input validation is a worthwhile addition, and a massive project. Patches with tests and helpful error messages are welcome. # Wed Feb 17 18:27:12 2016 The RT System itself - Status changed from 'new' to 'open' # Wed Feb 17 18:27:12 2016 steve [...] deefs.net - Status changed from 'open' to 'rejected' # Subject: [rt.cpan.org #98576] Date: Thu, 18 Feb 2016 16:03:50 -0500 To: bug-PDF-API2 [...] rt.cpan.org From: Phil M Perry

Would you be willing to cover these items if they're broken up into single item bug reports?

I'm not a mathematician, but I think what the spline() function is doing MAY be called a B-spline (or an approximation spline). If that's the case, it could just be clarified with a note in the POD. It would be nice to get some graphics experts participating in this discussion...

Per discussion on bogen() method (98541), we could decide to simply die() upon any invalid input found, rather than trying to fix it up and soldier on. In some cases, users might find it useful to be able to fix up bad input, so we might want to think about hooks for handling these cases, or at least, provide commented-out code. E.g., for bogen with too small of radius, have code to set the radius to the minimum allowable size.

November 14, 2016, 08:50:05 PM by Phil Some fixed in 3.001

  1. spline() POD entry discusses the spline type in detail.
  2. A few parameter checks have been added.

The rest of this is major work, and will have to wait for a later release. I would also like to get some feedback from the community on what they'd like to see changed.

November 18, 2016, 10:01:52 PM by Phil

We could add one or more new spline types (cubic, etc. that pass through all points), but I'd like to discuss this with the community before proceeding.

March 28, 2017, 02:26:45 PM by Phil

Regarding unnecessary restriction of data to INTEGER type, I looked around and now I can seem to find any such instances, either in the code or in the POD. Perhaps someone cleaned them up already. I'll keep an eye open, but for now it looks like this item is a dead letter.

Content.pl has been released in examples/, as has ContentText.pl.

The OO applicability, and text vs. graphics overlap, are still open issues. At the very least, they need to be better documented.

deg2rad() still needs to be looked at, to make sure 0 and 360 degree angles are different, if that is the cause of bugs when explicit conversion code was replaced with deg2rad() calls.

April 12, 2017, 08:55:21 AM by Phil

I have split out the discussion on text and graphics objects into its own topic (#59, CTS 7 - text and graphics objects), as it seems to be worth a major topic of its own. Please continue discussion on this subject over there.

April 12, 2017, 12:57:36 PM by Phil

Regarding bullet 1, I have added warnings to code (and POD) that deg2rad() wraps around at 360 degrees to 0. This is why the original concern about closed arcs (circle and ellipse: 0–360 degrees) not being able to use deg2rad(). It is unlikely that other uses of deg2rad() will encounter problems (possibly excepting some color specifications that use a color angle), but the POD update should keep people out of trouble.