PDF::API3::Compat::API2::Basic::PDF::Utils - Utility functions for PDF library


PDF-API3 documentation Contained in the PDF-API3 distribution.

Index


Code Index:

NAME

Top

PDF::API3::Compat::API2::Basic::PDF::Utils - Utility functions for PDF library

DESCRIPTION

Top

A set of utility functions to save the fingers of the PDF library users!

FUNCTIONS

Top

PDFBool

Creates a Bool via PDF::API3::Compat::API2::Basic::PDF::Bool->new

PDFArray

Creates an array via PDF::API3::Compat::API2::Basic::PDF::Array->new

PDFDict

Creates a dict via PDF::API3::Compat::API2::Basic::PDF::Dict->new

PDFName

Creates a name via PDF::API3::Compat::API2::Basic::PDF::Name->new

PDFNull

Creates a null via PDF::API3::Compat::API2::Basic::PDF::Null->new

PDFNum

Creates a number via PDF::API3::Compat::API2::Basic::PDF::Number->new

PDFStr

Creates a string via PDF::API3::Compat::API2::Basic::PDF::String->new

PDFStrHex

Creates a hex-string via PDF::API3::Compat::API2::Basic::PDF::String->new

PDFUtf

Creates a utf8-string via PDF::API3::Compat::API2::Basic::PDF::String->new

PDFLiteral

Creates a pdf-literal via PDF::API3::Compat::API2::Basic::PDF::Literal->new

asPDFBool

Returns a literal value in PDF output form

asPDFStr

Returns a string in PDF output form (including () or <>)

asPDFName

Returns a Name in PDF Output form (including /)

asPDFNum

Returns a number in PDF output form

unpacku($str)

Returns a list of unicode values for the given UTF8 string


PDF-API3 documentation Contained in the PDF-API3 distribution.
#=======================================================================
#    ____  ____  _____              _    ____ ___   ____
#   |  _ \|  _ \|  ___|  _   _     / \  |  _ \_ _| |___ \
#   | |_) | | | | |_    (_) (_)   / _ \ | |_) | |    __) |
#   |  __/| |_| |  _|    _   _   / ___ \|  __/| |   / __/
#   |_|   |____/|_|     (_) (_) /_/   \_\_|  |___| |_____|
#
#   A Perl Module Chain to faciliate the Creation and Modification
#   of High-Quality "Portable Document Format (PDF)" Files.
#
#=======================================================================
#
#   THIS IS A REUSED PERL MODULE, FOR PROPER LICENCING TERMS SEE BELOW:
#
#
#   Copyright Martin Hosken <Martin_Hosken@sil.org>
#
#   No warranty or expression of effectiveness, least of all regarding
#   anyone's safety, is implied in this software or documentation.
#
#   This specific module is licensed under the Perl Artistic License.
#
#
#   $Id: Utils.pm,v 2.0 2005/11/16 02:16:00 areibens Exp $
#
#=======================================================================
package PDF::API3::Compat::API2::Basic::PDF::Utils;

use strict;

use PDF::API3::Compat::API2::Basic::PDF::Array;
use PDF::API3::Compat::API2::Basic::PDF::Bool;
use PDF::API3::Compat::API2::Basic::PDF::Dict;
use PDF::API3::Compat::API2::Basic::PDF::Name;
use PDF::API3::Compat::API2::Basic::PDF::Null;
use PDF::API3::Compat::API2::Basic::PDF::Number;
use PDF::API3::Compat::API2::Basic::PDF::String;
use PDF::API3::Compat::API2::Basic::PDF::Literal;

use Exporter;
use vars qw(@EXPORT @ISA);
@ISA = qw(Exporter);
@EXPORT = qw(PDFBool PDFArray PDFDict PDFLiteral PDFName PDFNull PDFNum PDFStr PDFStrHex PDFUtf
             asPDFBool asPDFName asPDFNum asPDFStr);
no warnings qw[ deprecated recursion uninitialized ];


sub PDFBool
{ PDF::API3::Compat::API2::Basic::PDF::Bool->new(@_); }


sub PDFArray
{ PDF::API3::Compat::API2::Basic::PDF::Array->new(@_); }


sub PDFDict
{ PDF::API3::Compat::API2::Basic::PDF::Dict->new(@_); }


sub PDFName
{ PDF::API3::Compat::API2::Basic::PDF::Name->new(@_); }


sub PDFNull
{ PDF::API3::Compat::API2::Basic::PDF::Null->new(@_); }


sub PDFNum
{ PDF::API3::Compat::API2::Basic::PDF::Number->new(@_); }


sub PDFStr
{ PDF::API3::Compat::API2::Basic::PDF::String->new(@_); }

sub PDFStrHex
{ my $x=PDF::API3::Compat::API2::Basic::PDF::String->new(@_); $x->{' ishex'}=1; return($x); }

sub PDFUtf
{ my $x=PDF::API3::Compat::API2::Basic::PDF::String->new(@_); $x->{' isutf'}=1; return($x); }

sub PDFLiteral
{ PDF::API3::Compat::API2::Basic::PDF::Literal->new(@_); }

sub asPDFBool
{ PDF::API3::Compat::API2::Basic::PDF::Bool->new(@_)->as_pdf; }


sub asPDFStr
{ PDF::API3::Compat::API2::Basic::PDF::String->new(@_)->as_pdf; }


sub asPDFName
{ PDF::API3::Compat::API2::Basic::PDF::Name->new(@_)->as_pdf (@_); }


sub asPDFNum
{ $_[0]; }          # no translation needed


sub unpacku
{
    my ($str) = @_;
    my (@res);

    return (unpack("U*", $str));
}


1;