Buf

Handles the packing and unpacking of multi-byte quantities as network words. Such as `/BitsPerComponent` in `/Filter` `/DecodeParms`.

Also handles variable byte packing and unpacking. As seen in the `/W` parameter to XRef streams, and a few other places.

# pack two 4-byte words into an 8 byte buffer
use PDF::Native::Buf :pack;
my blob32 $words .= new(660510, 2634300);
my blob8 $bytes = pack($words, 24);
# pack triples as 1 byte, 2 bytes, 1 byte
my uint32 @in[4;3] = [1, 16, 0], [1, 741, 0], [1, 1030, 0], [1, 1446, 0];
my @W = packing-widths(@in, 3);    # [1, 2, 0];
$bytes = pack(@in, @W);

Subroutines

PDF::Native v0.1.14

Native drop-in native routines for PDF::IO

Authors

  • David Warring

License

Artistic-2.0

Dependencies

LibraryMakePDF::GrammarMethod::Also

Test Dependencies

Provides

  • PDF::Native
  • PDF::Native::Buf
  • PDF::Native::COS
  • PDF::Native::Defs
  • PDF::Native::Filter::Predictors
  • PDF::Native::Reader
  • PDF::Native::Writer

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.