Giter VIP home page Giter VIP logo

hornpenguin / booklet Goto Github PK

View Code? Open in Web Editor NEW
24.0 0.0 2.0 477.32 MB

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

Python 53.93% Tcl 4.82% Jupyter Notebook 40.91% Makefile 0.15% Batchfile 0.18%
book bookbinding signatures booklet booklet-format pdf pdf-service gui python section

booklet's Issues

Full Imposition Support algorithm development

Current

v 0.0.2
Current imposition routine

  • Standard imposition, $2^n$ leaves : Generation algorithm is implemented
  • 6, 12 leaves : Supported as pefixed setting

Further Plan

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.

Review of previous studies

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.

Resources

  • Y Jia, J Mitani, R Uehara, 2020, Valid orderings of layers when simple-folding a map, Journal of Inofrmation Processing.
  • Erik D. Demaine, Joseph O'Rourke, Geometric Folding Algorthms: Linkages, Origami, Polyhedra, Cambridge University Press, 2007.
  • Lang, Robert J, Twists, tilings, and tessellations : mathematical methods for geometric origami

UI improvement with progress bar

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 for inserted paper sections

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.

TODO

  • Add sub collection marks for each inserted sections.
    • Design indicator shape.

Multi-language support

Default language is English now but, maybe it will be wise to save all texts in UI as seperate resources to add translation.

Requirements load and save routines

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:

  • Choose requirements file format
  • Routine001: Converts to UI variables and displaying
  • Routine002: Converts UI settings to requirements settings
  • Routines003: Parsing requirements arguments to CLI

Support for duplex printer

Duplex printer

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 $180^{\circ}$ angle is commonly supported.
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.

Done

  • New duplex measuring marker routine is implemented in PrintingMark class.
  • New converter class Duplex is implemented.

Remains

  • UIs need to be updated for using new features
  • Documentation of Duplex routine

Repeating imposition

Current 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.

Features

  • Modifying gaps in x and y direction each.
  • Fit to frame or expand whole pages to cover repeated contents
  • Find full cover layout calculation.

Note utils

It will be implemented with Template class

Needed features

  • Manuscript expanding: 1/ 2 pages to the given number of pages
  • Header, Footer text add:
    • Page numbering: Each pages, only odd, or even, count all but note only odd or even ...
    • Indicating header-header, footer footer, header/footer alternatively per each 2 pags.
    • Align contents, if overlapped with numbering how can we set orders?

Requiring features: Text width calculation for the given string in pdf.

Done

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

Remains

All

Measuring text width per given height and string

Text width measuring

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.

Previous works

Using Pillow's text string method is popular on stackoverflow and the other sites.

  • Help me

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

Done

  • Basic font routines are implemented:
    • Load system fonts
    • points <-> pixel conversion for general setting.

Remains

  • Fonts routine wapper class implement compatible with fonttools library.
  • Measuring dpi for reportlab pdfgen routine.
  • Write width measuring based on reportlab routines.

Setting file exporting and importing routines

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.

Features

  • GUI: Export, import settings.
  • CUI: Add export setting in state and importing setting routine add.

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.