Group
Extension

Matches 4

PDF-Collage ( P/PO/POLETTIX/PDF-Collage-0.003.tar.gz, POLETTIX, 2025; MetaCPAN )
PDF-Collage/lib/PDF/Collage.pm ( view source; MetaCPAN )


use Carp;
use English                           qw< -no_match_vars >;
use JSON::PP                          qw< decode_json >;
use Scalar::Util                      qw< blessed >;
use Data::Resolver
  my $ar = ref($auto);
      if ($ar eq '' && $auto =~ m{\A [\[\{]}mxs) {
         $auto = decode_json($auto);
         $ar   = ref($auto);
      }
      return collage_from_definition($auto)
        
ak 'no useful input';
} ## end sub collage

sub collage_from_definition ($def) {
   $def = decode_json($def) unless ref $def;
   $def = {commands => $def} if ref($def) eq 'ARRAY';
   return PDF::Colla
PDF-Collage ( P/PO/POLETTIX/PDF-Collage-0.003.tar.gz, POLETTIX, 2025; MetaCPAN )
PDF-Collage/lib/PDF/Collage/TemplatesCollection.pod ( view source; MetaCPAN )
to assemble the target PDF.

=back

The definitions are supposed to be JSON file matching keys
C<\A(?:\./)?definitions/(.*)\.json\z>. The part in the capture group is
one of the available L</selectors
PDF-Collage ( P/PO/POLETTIX/PDF-Collage-0.003.tar.gz, POLETTIX, 2025; MetaCPAN )
PDF-Collage/lib/PDF/Collage/TemplatesCollection.pm ( view source; MetaCPAN )
TemplatesCollection;
use v5.24;
use warnings;
{ our $VERSION = '0.003' }

use Carp;
use JSON::PP qw< decode_json >;
use Scalar::Util qw< blessed >;
use PDF::Collage::Template ();

use Moo;
use experim
s => 'lazy');

sub _build__selectors ($self) {
   my @selectors =
      map  { s{\.json}{}rmxs }
      grep { m{\.json \z}mxs }
      $self->resolver->get_sub_resolver('definitions')->list_asset_keys;
er('definitions')
#      ->get_asset("$selector.json")->parsed_as_json;
   my $def = $resolver->get_asset("./definitions/$selector.json")->parsed_as_json;

   $def = { commands => $def } unless ref($d
PDF-Collage ( P/PO/POLETTIX/PDF-Collage-0.003.tar.gz, POLETTIX, 2025; MetaCPAN )
PDF-Collage/lib/PDF/Collage.pod ( view source; MetaCPAN )
t it should support:

   definitions/bar.json
   definitions/foo.json
   definitions/galook.json
   existing-file.pdf
   logo.png

Every key ending with C<.json> and starting with C<definitions/>,
opt
ition);
   my $pc = collage(definition => \@array_definition);
   my $pc = collage(definition => $json_hash_or_array);

This is a I<Do What I Mean> catchall function to generate an instance of
either 
tion>.

If the definition is a string starting with either C<{> or C<[>, it is
considered a valid JSON string and decoded as such, then processed as
follows.

If the definition is an array reference, 

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.