momijizukamori / bookbinder-js Goto Github PK
View Code? Open in Web Editor NEWA JS application to format PDFs for bookbinding.
License: Mozilla Public License 2.0
A JS application to format PDFs for bookbinding.
License: Mozilla Public License 2.0
Current version is pretty basic and doesn't offer much in the way of user feedback.
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.
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.
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)
possibly related to #39
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
)
Create a .txt file describing the settings used that is included in the .zip folder output
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
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!
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:
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.
Hi @momijizukamori, I was having an idea of designing a beautiful layout for the website - https://momijizukamori.github.io/bookbinder-js/
Before:
After:
This is only an example(made in figma) how the website will look, will add many more stylings to the website, so that it will will look attractive to the user.
I'll create the PR ASAP, so that you can review it.🙏🙏
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....
Functionality for eg 20-page signatures imposed quarto.
Vague ramblings on how it could function:
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)
x = math.ceiling(p/n) * n - p
(x will also be 0mod4)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
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.
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).
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.
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
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
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)
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)
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
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
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
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)
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 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
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.
Book.update()
)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!
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...
see: https://discord.com/channels/726108551428440206/953709370267541634/1166583413566873691
Am unclear where the "add a fly leaf" logic currently resides, but it should totally be moved into the createpages
method where we handle PDF source rotation. That way it'd apply everywhere easily without special concerns
(it's an enhancement because I never meant for it to apply to Wackies originally but now it seems like a good idea, once raised)
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? )
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
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:
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 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:
Expected view (visible features):
From discussions in #shop-talk on Oct 7th 2022 by Shang Timhua (Tim)[sprx77#2936] : https://discord.com/channels/726108551428440206/726108789161590916/1028166854205767752
Looks like the perfect bound has a Total Pages: NaN
and errors right away when you try to generate because pagelist
is null at time of writepages
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
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
when what i wanted was
Don't forget to ping marvin when completed
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.)
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.