|
Paper::Specs - Size and layout information for paper stock, forms, and labels. |
Paper::Specs - Size and layout information for paper stock, forms, and labels.
use Paper::Specs units => 'cm'; my $form = Paper::Specs->find( brand => 'Avery', code => '1234');
use Paper::Specs units => 'cm', brand => 'Avery'; my $form = Paper::Specs->find( code => '1234');
# location of first label on sheet my ($xpos, $ypos) = $form->label_location( 1, 1); my ($h, $w) = $form->label_size;
I appologise in advance for the hasty nature of this code. I want to get it out to support some other code I am writing. I promise to revisit it shortly to clear up the rough patches - however your valuable input is most welcome.
CAVEAT ALPHA CODE - This is a preliminary module and will be subject to fluctuations in API and structure based on feedback from users.
I expect that there will be some interest in this code and it should firm up quickly.
If this module does not deliver what you are looking for then you are encouraged to contact the author and voice your needs!
OTHER LABELS - I know about the Labels.xml file which is part of OpenOffice but have not figured out how it is encoded. I have the gLabels specifications file too. I plan to use these to help populate the data for this module.
use Paper::Specs
strict => 1,
units => 'cm';
You must supply at least a brand or a code to find. If no brand is supplied then all known brands will be searched.
If you set the module to strict, its default, the find must return extactly zero or one forms as a scalar. Otherwise it will throw an exception.
See the beginning of this module for examples of finds.
Current units supported are: in, cm, mm, and pt.
As well 'pdf' calls units('pt'). You can reset this afterwards if you are working in a different unit system.
The default is to be strict.
You get little object references back when you find specifications. These objects can supply you with information that you are looking for but do not actually store any values.
You should test that the object is of the type you are looking for
if ($form->type ne 'label') {
die "Feed me labels Seymore\n";
}
Other than that - most forms should be based on a sheet (of paper) but will have different methods depending on what they are.
These methods apply forms of type 'sheet' and all that are derived from it. (all other forms and stock)
These methods apply to forms of type 'label' and all that are derived from it.
Inherits methods from Paper::Specs::sheet.
Paper::Specs homepage - http://perl.jonallen.info/projects/paper-specs
Please report your bugs and suggestions for improvement to <jj@jonallen.info>.
Originally written by Jay Lawrence <jlawrenc@cpan.org>
From version 0.06 onwards this module is maintained by Jon Allen (JJ) <jj@jonallen.info> / http://perl.jonallen.info
Copyright (c)2001-2003 - Jay Lawrence, Infonium Inc. All rights reserved.
Modifications from version 0.06 onwards Copyright (c) 2004-2005 Jon Allen (JJ).
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Software distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. This software is not affiliated with the Apache Software Foundation (ASF).
|
Paper::Specs - Size and layout information for paper stock, forms, and labels. |