COS
Synopsis
use PDF::Native::COS;
my $stream = q:to<--END-->;
<< /Length 45 >> stream
BT
/F1 24 Tf
100 250 Td (Hello, world!) Tj
ET
endstream
--END--
my COSIndObj $ind-obj .= parse: "123 4 obj\n{$stream}endobj";
say $ind-obj.ast.raku; # mimic PDF::Grammar::COS.parse( $_ , :rule<ind-obj>);
say $ind-obj.value.dict<Length>.cmp($val); # derefencing and comparision
say $ind-obj.write; # serialize to PDF
my COSInt $val .= parse: "42"; # simple object parse
Description
This is under development as a set of objects for the native construction and serialization of COS (PDF) objects.
It is optionally used by PDF::IO::Reader and PDF::IO::Writer to boost reading and writing of larger PDF files.