hornpenguin / booklet Goto Github PK
View Code? Open in Web Editor NEWMaking Booklet file from your own PDF
Home Page: https://docs.hornpenguin.com/projects/booklet/en/latest/index.html
License: BSD 3-Clause "New" or "Revised" License
Making Booklet file from your own PDF
Home Page: https://docs.hornpenguin.com/projects/booklet/en/latest/index.html
License: BSD 3-Clause "New" or "Revised" License
v 0.0.2
Current imposition routine
For perpendicular and parallel creasing patterns of paper, its right order layout algorithm will be implemneted.
Thus, all kinds of sections folding types will be supported if they are possible, physically.
Determining such works are proved as NP-Hard problem if we started from creasing pattern of the paper.
Without loss of generality, we will start from fold sequence. It is not only enough for representing all types of section folding, at least equivalent, moreover, this makes us to avoid such NP-Hard probelm in implmentation and to focus on real layout algorithm development.
Version 0.0.1 has a progress bar routine in GUI mode but it is deprecated after 0.0.2, since there was lots of changes in structure.
New progress routines is needed for better user experience but, it does not need to be same with previous one.
Improved version will be more represent the full routines of Project and can visually show step by step progress of manuscript.
It will show pipe filter activation, deactivation and selected filters in setting.
Collection mark is supported to identifying sections in collection.
If one section is composed of multiple inserted sub sections, the primary section, wihch is visible section from back, section is the only one get collection mark.
However, inserted sections must have an order identifiers not to be confused other subsections in gathering process.
Default language is English now but, maybe it will be wise to save all texts in UI as seperate resources to add translation.
Processing works of document require various settings for each steps of work.
Save and load requirements setting could prevent tedious typing works for users.
Jobs:
The duplex printer printing contents on both side per each page.
It depends on printing devices but, the duplex printing does not perfectly fit.
Considering rotation during printing, rotatting even pages with
However, addtional transformations, translation and rotation are required for perfect fitting of printing.
In addition, new printing mark is needed for measuing geometrical inbalance of front and back contents.
PrintingMark
class.Duplex
is implemented.Duplex
routineCurrent Imposition routines is aming to be used in bookbinding or pamplet printing.
However, repeated imposition is widely used in printing, for example, business card prinitng.
It will be implemented with Template class
Needed features
Requiring features: Text width calculation for the given string in pdf.
Basic interface design is done
Note Mode : On/Off
Note Pages: Total number of Note <- Must be a multiple of 4
Page numbering:
None,
{[Header, Footer], [HF, FH]},
[Both, ODD(n), ODD(y), EVEN(n), EVEN(y)],
{[L ,R ,C], [LR, LL, LC, RR, RL ,RC, CC, CR, CL]}
Header: None, [Both, Odd, Even], [Align], size, repeat by
Footer: None, [Both, Odd, Even], [Align], size, repeat by
All
Optimizing Signature composition and rearrangement routines
See program The Signature Optimizer
developed by Carl McTague.
Its details are written at How to Optimize Codex
In writing texts in template pdf file, its precise dimension is required before applying to real pdf page.
Overlapping objects on result pdf could not be desired result for all situations.
Now its routine is only required by Note utils but further routines would require this feature.
Using Pillow's text string method is popular on stackoverflow and the other sites.
I implmented prototype version and tested it but pts and point conversion has an issue.
from PIL import Image, ImageDraw, ImageFont
def get_text_dim(string, font_file: str, size):
im_width = len(string) * size
im_height = size
bg_color = (0, 0, 0)
# Generate string as image
im = Image.new("RGB", (im_width, im_height), bg_color)
draw = ImageDraw.Draw(im)
font_PIL = ImageFont.truetype(font_file, size)
draw.text((0, 0), string, font=font_PIL, fill=(255, 255, 255))
bbox = im.getbbox() # left, upper, right, and lower pixel coordinate
width = bbox[2] + bbox[0]
height = bbox[3] + int(bbox[1] / 2)
return width, height
Others
From PyPDF2 to borb
Settings for converting are very large, so it is imposible for users to type all the setting by typing on console terminal.
Including
Yaml file will be applicable for srtting format.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.