Coder Social home page Coder Social logo

Comments (7)

tbrowder avatar tbrowder commented on June 24, 2024

I'm closing this for now. I may submit a PR.

from pdf-lite-raku.

tbrowder avatar tbrowder commented on June 24, 2024

I will be glad to submit a PR to demo some of this. Using PDF::Lite I have been able to read and set the media-box coords individually and also use .to-landscape on it.

However, I still need to be able to use the Content::PaperSizes to set the media-box but haven't yet been able to so so.

from pdf-lite-raku.

tbrowder avatar tbrowder commented on June 24, 2024

I see how now. Closing this again and I will submit a PR later.

from pdf-lite-raku.

tbrowder avatar tbrowder commented on June 24, 2024

I copied the following from PDF::Document::Page into my top-level working directory:

# Copied from PDF::Content
my subset Box of List is export where {.elems == 4}
sub to-landscape(Box $p --> Box) is export {
	[ $p[1], $p[0], $p[3], $p[2] ]
}
# These are the standard paper names and sizes copied from PDF::Content
my Array enum PageSizes is export <<
     ...
>>;

Then I wrote a new sub:

sub set-media-box(PDF::Content::Page :$page!, 
                  Str :$Media!, 
                  :$landscape = 0
) is export {
    die "FATAL: Media '' is not known in enum 'PageSizes'"
        unless %(PageSizes.enums){$Media}:exists;
    if $landscape {
        $page.media-box[] = to-landscape(PageSizes.enums{$Media});
    }
    else {
        $page.media-box[] = PageSizes.enums{$Media};
    }
}

That works for me for now. Elevating those PDF::Content vars to be accessible from PDF::Lite would ease the pain.

from pdf-lite-raku.

tbrowder avatar tbrowder commented on June 24, 2024

OBE

from pdf-lite-raku.

jubilatious1 avatar jubilatious1 commented on June 24, 2024

Very nice! Will test soon.

from pdf-lite-raku.

tbrowder avatar tbrowder commented on June 24, 2024

Better to see the open issue here where I have a corrected script that doesn't yet rely on my modules.

BTW, my email is '[email protected]' if you'ld like to communicate more directly. Since you're apparently the only person who is interested in my PDF modules, I could use answers to the following:

  • What country are you from?
  • If not the USA:
    • What Google Nota font language selections would you like me to provide for use with my modules?
    • What standard paper sizes do you use?

from pdf-lite-raku.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.