Code Monkey home page Code Monkey logo

bookbinder-js's People

Contributors

jackal-ate-jill avatar krishnakrish24 avatar momijizukamori avatar sithel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bookbinder-js's Issues

Feature: nicer UI

Current version is pretty basic and doesn't offer much in the way of user feedback.

  • info tooltips? (possibly with Balloon.css for accessibility)
  • better feedback about issues (bad/missing sizes, etc)

Bug: Info icon does not render properly

This issue may be Mac-specific - I did not encounter it on my Windows machine and have not tested it in other environments.

On my Mac (macOS Monterey 12.2), the small 'info' icon renders as a blank square in Chrome, Safari, and Edge. Firefox shows a square with some characters inside. See screenshots for examples.
Screen Shot 2022-03-07 at 11 50 32 AM
Screen Shot 2022-03-07 at 11 56 37 AM

The tooltip information works as-expected, it's just the icon that doesn't display. An icon may need to be bundled in with the app to ensure that it can be displayed properly in different environments.

Feature: double leaves per sheet

Add the ability to print double the number of leaves per sheet with the intention of cutting them in half after (ie, four pages on each side instead of two). Handy for people looking to make tiny books, and for dealing with paper (ie, if you have a large office printer that takes both letter and tabloid paper, the tabloid size is more likely to be the correct grain direction after cutting)

Feature: documentation

  • crosslink the live Github Pages app with the repo
  • Add 'how to build' docs
  • Add 'how to use docs'

Fix Alternate Rotation issue (only with Folio)

possibly related to #39

Screen Shot 2024-01-03 at 6 52 33 PM

as debugged on call! yaaaaaaaay! Thanks @ReachBlueDot & @momijizukamori

My suggestion is hack at calculate_dimensions() -- look around let layout = this.page_layout; and corner case the fuck out of folio duplex to add in page rotations

Maybe then also look at the page ordering over in BOOKLET_LAYOUTS (in constants.js)

Actually WAIT for the PDF to load

Thanks to Kameron for raising this issue by finding it with a 784 page PDF....

In async openpdf(file) { we have this.currentdoc = await PDFDocument.load(this.input); and I can see us hit that, pause, and then wait for... yikes, it took ~60 seconds on my machine? With no UI updates (looks broken) and then we eventually progress beyond that step.

Need to add some sort of UI to reflect this progress

Feature: Advanced control over scale and margin options

Give people options for how to place pages from the doc onto sheets, particularly when the doc page size does not match the sheet page size - for example, to split the difference in margins evenly between sides, or to put it all to one side or the other. Ideally with a nice little visual diagram to show what's happening!

Quarto seems not to be printing properly

Hi!

First, thank you for developing this! I am a big fan of Bookbinder 3.0 and was happy to find this project by chance.

I am having some issues, which I don't know if it's a bug or my incompetence. As most of A4 papers are long grain I am trying to make A6 books to practice bookbinding. So I decided to use the quarto function on A4 to get the grain direction right. But when I fold the papers according to the instructions, I can't seem to get the page order right.

In order to save paper to try I am using 2 A4 sheets for signatures, so 16 pages each.

I tried to fold the 2 sheets together and separate. Neither worked. The page 14 is behind the page 1, for example, so I don't think is because of the way I am folding.

These are my settings:

  • Paper size: A4
  • Printer type: duplex
  • Page layout: quarto
  • Page scaling: keep proportional
  • Page positioning: centered
  • Add flyleaf: no
  • Standard signatures - length: 2 (I tried with other numbers too, but to save paper I lowered it to 2)

Print:

First sheet (front):
7  10
6  11
First sheet (back):
5  12
8  9
Second sheet (front):
3  14
2  15
Second sheet (back):
1  16
4  13

Any help is appreciated.

Use URL params to allow import/export of settings

Obviously we can't share the raw files, but it'd be nice if we could share exact imposer settings. Seems like it shouldn't be too hard to slap on a pile of params (and read them at time of loading?) to enable this. There's probably a library out there that makes this extra easy....

Recording idea-- don't think it's a great starter project, but anyone should feel free to tackle it if they'd like. Otherwise I'll get around to it..... eventually....

Support for signatures with 4mod8 pages in quarto etc

Functionality for eg 20-page signatures imposed quarto.

Vague ramblings on how it could function:

  • input as decimal into same box as always (potential for error, esp with 6 per side and the other wacky small layouts)
  • have a tickbox for "Partial Sheet Signatures (quarto and smaller only!)" and then input either:
    -- number of pages per signature (potential for error if not a multiple of 4)
    -- number of physical layers of paper per signature (effectively treating it like a standard a5/half-letter book, advantage that the correct input is any integer, so no room for error on decimals or multiples of 4) <- this option probably best

In terms of pseudo-code functioning (as I do not know js, I think this is the order in which it does things but I'm not 100% sure I've got it right) (n is number of pages per sheet, p is pages per signature = 0mod4)

  • do the thing that splits the doc into signatures with p pages
  • x = math.ceiling(p/n) * n - p (x will also be 0mod4)
  • add x/2 blank pages to each end of the signature
  • rearrange and impose as normal?

this should give x/4 blank pieces of paper on the outside of the signature once folded and cut
in terms of error margins when dividing, currently 4/60 (0.0666) is the minimum step, so an accidental full-sheet signature number should be fine if error is 1e-2 or lower. Alternatively there should be a way of calculating x without dividing (Python equiv below)

y=n    # (or 0)
while y<p:
   y=+n 

x=y-p

Display "source PDF page" as laid out on "destination paper page" as part of page UI

After talking to Kameron and stewing on it (and using a mini layout that'd been printed on a wider paper) -- really think this would be helpful.

Needs to display 2 overlapping rectangles & the dimensions (initially in the unit of "Points") after a generate or preview cycle once the calculations have been run. Take into account scaling and positioning settings.

BUG (?): Summary Transposing Number of Signatures & Signature Arrangement

When I was working yesterday I noticed that the summary section here seems a bit buggy https://d.pr/i/O6TqUT. Sometimes the "Number of Signatures" number and "Signature Arrangement" numbers were transposed; in that screenshot it implies 4 total signatures of 6 pages each but what it actually produced was 6 total signatures of 4 pages each (which is what I wanted). So it's technically working, it's just that the summary is sometimes misleading (it jumped around a lot and kept spitting out different configurations of sheets per signature depending on what I changed in the "sheets per signature" box, although the total number of sheets in the aggregate didn't change).

Feature: Support stab-binding layouts

Theoretically you could use the perfectbound setting for this, but this hasn't been tested at all and I strongly suspect it behaves badly on quarto/octavo/sexidecimo layouts as I calculated all of those assuming signatures. It would also be good to have options for what is effectively one-page signatures with either the fold at the spine or the fold at the fore-edge.

Offer option to reduce final signature to minimum page count

Request from marvinhere — Tuesday, September 20 at 9:36 PM

question re: the octavo (first one) on the imposer
you know if it tries to minimize blanks?
right now my docs at 213 pages, so in octavo with one sheet of letter paper being one signature (four small book sheets), i'll end up with 11 blank pages in the final signature
can the imposer make it such that the final signature, being printed over two pages, can be arranged as a six book sheet signature with only 3 blanks?

Gotta' go... find the right place to condition this (and present it to the UI) but should be totally doable.
Be sure to ping marvin when completed

BUG Petite and sextodecimo not working

Malamishka from the discord:

Anyone else having issues with the imposer? I'm trying to do a sextodecimo but Chrome and Firefox keep giving me error messages or just don't generate anything. Last night Microsoft Edge worked, but isn't anymore.
[…]
Thanks! Rebooted, cleared cache, tested with a different folio typeset (that worked).
But I can't get the Petite/sextodecimo to work...
Sextodecimo is greyed out, and when I select Petite it says there's 0 pages in the Signature Info section
It'll just generate an empty zip file
[…]
Hmm, so I currently have it on sexto but nothing will generate. It'll be generating for a bit then stop without producing anything

question: which source manipulation to use for stapling at the middle

Hi I have the below content in the pdf for which I would like to generate output:

mypage_content_vertical = [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
]

which source manipulation can be use to generate the output such that when printed on both side it can be stapled at the middle.

page 1: 
 front:
   first-half: page 2(start to center)
   second-half: page 15(center to end)
 rear:
   first-half: page 16(start to center)
   second-half: page 1(center to end)

page 2:
 front:
   first-half: page 4(start to center)
   second-half: page 13(center to end)
 rear:
   first-half: page 14(start to center)
   second-half: page 3(center to end)

page 3:
 front:
   first-half: page 6(start to center)
   second-half: page 11(center to end)
 rear:
   first-half: page 5(start to center)
   second-half: page 12(center to end)

page 4:
 front:
   first-half: page 8(start to center)
   second-half: page 9(center to end)
 rear:
   first-half: page 7(start to center)
   second-half: page 10(center to end)

Possible Bug: Folio format occasionally transposing pages

The pdf itself looked fine after being run through the website, no red flags, it’s just when I printed it it appears as if some of the pages were transposed so there wasn’t a way to fold it so numbers ran correctly. When I ran same pdf file through the old version it compiled correctly. II kept signature size the same between the old version of the website and new version of the website, when I printed the settings were the same

Top is correct (done on old version) bottom is incorrect (done on new version)
cover

The front and back pages of the middle of the signature as its easier to see what I mean using this page as an example
middlefront
middleback

Here's me attempting to fold it. Attempting to fold, page order would be 6, 4, 5, 3. Three and four should be back and front rather than opposite side
fold1
fold2

Add indicator dots to spine of outer folio of each signature

see: https://discord.com/channels/726108551428440206/953709370267541634/1167723417529753720 (and then down a bit the conversation resumes/continues)

The idea is that the outside of the outermost folio gets dots at key points along the spine (for help with trimming and/or punching)

This is particularly important on layouts that have buffer space at header and footer that one might want to trim w/o risking trimming of text. Would pair well with the pending #55 if creators shifted their margins from the PDF into the Imposer tool

Shouldn't take a lot of work to add, just need to figure out where to best surgically insert it into the code... (and what exactly is the enabling/configuring UI?)

please ping badgertide if this gets done

[Discussion] Discord server for development/help?

Mostly because the main Renegade server has gotten WAY too big for me to keep up with any more, which is why I have not been around to do dev work much. It would also give an avenue for people not on the Renegade server who aren't familiar with Github to go to for help - I had some DM me on twitter because they were having issues (and I have not had a chance to investigate them because Life)

Add more Mini fold-up/folio options

From Kulapti (KQ#3584) see: https://discord.com/channels/726108551428440206/750875955219922964/1068368688236998656

I'd prefer it to be in 3-4 page sets instead of 2-3 . I haven't tried at all to figure out how to simplify the folding for that though, it might end up being a lot more trouble to cut out the pages

I read "3-4 page sets vs 2-3" as a row of 5 folios, 3 of which were one sig, 2 of which were part of another sig split across 2 rows. So still 6 rows, 3 folio each, with a tail end of 3 4-folio sigs (6/2 = 3)

Also from potatoe#4771 see: https://discord.com/channels/726108551428440206/750875955219922964/1068610944885854278

if possible it would still be nice to add the 5 page option maybe...

The split row option would be a headache (have to lay out in batches of 40 🙄 ) but still very doable
The main blocker here is re-working the UX so that Wacky selection doesn't take up over half the page (blocker for several other new impositions too, really)

Add “developed and maintained” line to UI

Add line approximating “This tool is developed and maintained by members of the Renegade Bindery discord server” onto the UI somewhere

@momijizukamori this can probably be tagged as a good first issue if you can point where to put it on the UI/relevant place in the code

Feature: support different units for papersize

Some of the code is there via the QE port but it didn't seem to be wired to anything, so the UI options are currently commented out.

  • Figure out what sizing PDF-Lib reports cropbox as (it seems to be mm, but good to double-check)
  • Add inch <-> mm conversion functions
  • add the actual conversion calculation (probably in Book.update())
  • Add option for custom paper size?

Debug .txt file in zip

reminder to myself that this is a good idea... I'm finding a bunch o folders pile up when I'm working and the file name alone doesn't cut it... help yourself, future me! implement this!

Support single PDF file

Totally get the value of per-signature files after fumbling some punching today 🙄 but am going to add support for a coallesed single PDF as well, as part of download zip

Might also toss in a txt file of what the settings were for debugging purposes? If I can figure out how/if it's easy...

Imposer stops on certain files without producing output when using "Duplex"

So, I'm having a recurring issue with certain files: When starting the imposition, the "Generate Output" button turns gray and gives the usual "Generating, this might take a while" message, then goes back to "Generate Output", without having produced any files or giving any errors.

By accident, I've produced two files that allow testing it: One works, the second, identical but for a single image added, does not.

Both are pdf 1.6 files generated using Scribus 1.5.8, in case that matters.

Works: blank-notebook-with-index.pdf

Doesn't work: blank-notebook-with-index-with-image.pdf

Imposer Settings: A4, Quarto, Duplex, Signature length 5

Tested in Firefox 114.0.1 on Linux.

(When setting the Imposer to single sided, the second file works but produces a 600MB zip file for some reason, with every file ballooning to 60 MB, where they are ~200KB for file number 1. My guess: Something in file number 2 is causing some loop to run wild, resulting in huge file and thus memory sizes? And if it tries to dublex them, the imposer runs into some file size/memory limit and the thread is silently killed? )

Add license to all files

License is currently in a single file in the repo but should be at the start of every file in accordance with MPL standards.

@momijizukamori if you can provide the license that needs to go at the top of each file (slash confirm that the license file is fine to be copy and pasted into each file), this can probably be tagged as a good first issue

Missing layout

Hi there!

That's a great app. Thank you for developing it. :)
I faced an issue while trying to setup printable PDF through that app. My case is as follows:

  • I want to use A4 size paper with grain directed over the long edge;
  • My input PDF is with pages wich width is half the A4 width;
    изображение

And the goal is to make PDF with such layout:
изображение

But I couldn't achieve that setup in your app.
Do I miss something or if not, do you plan to add that kind of layout?

Thanks!

Add "Beginner-friendly" view

Add checkbox for "beginner-friendly view" at the top of the page, inside "Bookbinder JS" box. Checking this box will enable a simplified view, hiding most features and picking defaults for certain options.

Hidden features:

  • Source Manipulation box
  • Custom paper dimensions, rotate paper 90°, alternate page rotation
  • Page layout (defaults should be set to folio layout, proportional scaling, centered position, and downloading both aggregated and signature files)
  • Wacky Small Layouts
  • Perfectbound and custom signature settings

Expected view (visible features):

  • File Info
  • Printer (paper size, pick display unit for paper, choose printer type)
  • Flyleaf
  • Standard signature length in Signature Format
  • Signature Info
  • Generate Output button

Imposer cannot do landscaped octavo pages layout. Requires different imposition

Another from marvinhere — Tuesday, September 20 at 10:00 PM

i don't think the imposer can do landscape octavo pages, and the arrangement needed for that is different from portrait octavo pages. I figured this via manually printing a test using multiple pages

Photos were provided to expand upon this
marvin3
marvin2
marvin1

And further

I also tried doing an octavo as the uhhhh the Dutch small books? think the John green specials
arranged the images as landscape on landscape octavo pages
when took it into a PDF editor to rotate them so theyre portrait
with the hope that the imposer will treat them as portrait pages that bc the book page contents are arranged landscape, will be read as the Dutch minis
marvin4
when what i wanted was
marvin5

Don't forget to ping marvin when completed

BUG: signature info lagging

From medrengirl on the discord

I'm having an odd problem on the Imposer this morning! the signature info section at the bottom is not producing the right information for the settings I have chosen. The actual PDF that is produced seems right, but the info section seems to be lagging one choice behind whatever I've chosen for the number of sheets per signature. (So if it had default set to 5 sheets per sig and I change it to 3, it shows me info for 5. If I then change it to 4, it shows me info for 3.)

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.