Comments (7)
I'm closing this for now. I may submit a PR.
from pdf-lite-raku.
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.
I see how now. Closing this again and I will submit a PR later.
from pdf-lite-raku.
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.
OBE
from pdf-lite-raku.
Very nice! Will test soon.
from pdf-lite-raku.
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)
- Need a .page.gfx.current-point method HOT 5
- Please show how to align text horizontally (left, right, centered, justified) with PDF::Lite HOT 3
- Some chars are removed in code blocks HOT 1
- Unable to use :translate with PDF::Lite HOT 1
- Setting media-box on the first page seems to affect the entire document HOT 2
- The initial example in the README is incorrectly setting the document media-box. HOT 3
- Add a short example using a non-core font from a font file path HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdf-lite-raku.