I can't seem to figure out if it is possible to print a multi page PDF via CUPS where I select different options at different points of the PDF. Is anyone able to confirm whether this is possible and how? I plan to communicate with CUPS via api.
e.g. Pages:
Page 1 . Colour, Headed Paper, Portrait
Pages 2 - 10 . B&W, Plain Paper, Portrait
Page 11 . B&W, Plain Paper, Landscape
I know that I can control these options for a PDF in its entirety, an example of this is here
The only way I can see of doing this is to split the PDF into three parts and print them separately but that would end up as three jobs going to the printer meaning that they could end up with a random print (from someone else depending on timing) between them.
If this is the only way, is there a way to capture the output and combine them to one file which then gets sent to the printer?
Related
I've been using a shell script with pandoc to create multiple page pdf files. I can specify the size of the page... but if we consider this "page" to be a sheet of paper (the pdf gets printed onto paper)... I want to actually have multiple pages per sheet - 2 pages on each side of the side of the paper. 4 pages get printed to each sheet of paper (and the paper gets folded in half).
Depending on the style of printing, the ordering of pages is different:
for "booklet" printing where all the pages are stacked together and then folded once together, the page ordering of an 8-page (2 sheets of paper) document would be pages 8 & 1, on the back of that pages 2 & 7, on the next sheet pages 6 & 3, and on its back 4 &5.
for "book" style printing, where each sheet gets folded on its own, and then the folded sheets placed together, the order is different: page 4&1 with 2&3 on the back, and the next sheet pages 8 & 5 on one side with 6 & 7 on the other.
The desktop publishing program called Scribus (among other design-to-print softwares) has functionality for ordering the pages like this (for reference of the intent which I describe this article describes the situation). But I don't want to use a GUI like Scribus. I'm writing the pages in markdown in Vim and generating the pdf from the command line.
Does pandoc have a way of ordering pages like this?
As you state in comments "It might be that pandoc can NOT do this" without some TeX fettling.
I had previously given an answer with visuals of flat in TeX eXchange to a versatile 32-Up page way imposition can be done in LaTeX (and thus an 8 page should not be a problem by trimming down the answer)
see https://tex.stackexchange.com/questions/494047/a-tex-script-to-impose-multiple-layout-signatures-optionally-saddle-stitch-fro/494232#494232
Simple Imposition (booklets and n-up print compositing) can be done by other PDF orientated CLI tools that Pandoc uses but the last time I built a LaTeX program (Linked Above) it was a pain to get right.
More recently I wrote similar function to work inside SumatraPDF reader and for that I used simple CMD batch commands via either N-Up-PDF or cPDF as they do the basic stuff like rotate join 2 and reorder to booklets but you may need to adapt to suit your own use.
My RTFManual (Rich Text Format) for install/usage are in PDF #
https://github.com/GitHubRulesOK/MyNotes/raw/master/AppNotes/SumatraPDF/Addins/N-Up-PDF/N-Up-PDF.pdf
Okay, here's what's going on..
I have a folder that has 200 images in it.
They're all named - p001.png, p002.png, p003.png... all the way up to p200.png
I need to create an Action that pulls in 2 images at a time, in ascending order.
After Resizing & Positioning the images, I need to add text above each image that says "Image #X"
(in place of 'X', would be the number of the corresponding image)
Once it finishes with the 1st two images, it saves it in a specified folder; and pulls in the next 2 images.
And just repeats the process until it goes through all 200 images.
Here's my 2 questions:
1 - Is it possible to pull in 2 images at a time in ascending order, from a specified folder, via an Action?
2 - Is it possible to replace 'X' with the image's number, as it moves up in ascending order?
Any kind of help with this would be Greatly appreciated.
Thanks in advance!
p.s. I'm using PhotoShop cs5.5 if that makes a difference
First checkout the Contact Sheet functionality, perhaps you can achieve your tasks this way.
In terms of scripting, there are indeed functions available to :
load a file into the document
create a text layer
set the text of the text layer
Check out the Photoshop CS5 JavaScript Language Reference for more details.
Additionally, you should have Extend Script Toolkit installed as well.
Run Extend Script Toolkit then give this a quick go:
#target photoshop
alert("Hello World!");
Using the Object Model Viewer (available under the Help menu) you should be able to select the Photoshop Type Library and view useful available objects such as Application,Document,Layer, etc. and see their properties and methods.
Additionally the Data Browser panel and autocomplete should help.
In the context of my studies I often receive PDF files written in LaTeX, with big margins.
When I have to print those files, I like to print them with 2 pages per sheet to spare paper. But I then have a lot of white-space and the text is quite small.
So I'm looking for a way to scale the page contents first and only then print them 2 pages per sheet, to avoid losing space and to have the text as big and readable as possible.
Has anyone an idea of how I could do that either programmatically, or scripted, or on a "step-by-step commands" basis ?
(Note that I have no access to the LaTeX code, otherwise I would just change the margins...)
I used FinePrint to do this on windows. But there are some alternatives, which I haven't try:
https://superuser.com/questions/190869/fineprint-alternative-on-linux
https://superuser.com/questions/107687/good-virtual-printers-with-cropping-for-windows-and-linux
Here are previous answers (all mine) which provide building blocks that will help you construct your own programmatic or scripted or "some step-by-step commands" solution:
PDF Manipulation: "2-Up" page layout (SuperUser)
Linux-based tool to chop PDFs into multiple pages (SuperUser)
Convert PDF 2 sides per page to 1 side per page (SuperUser)
How can I split a PDF's pages down the middle? (SuperUser)
Cropping a PDF using Ghostscript 9.01 (StackOverflow)
Split one PDF page into two (StackOverflow)
PDF - Remove White Margins (StackOverflow)
I have a very specific request about printing PDFs.
What I have is 294 documents that need to be printed. Usually what we do if they are all 8.5x11 or 11x17 is use the "Choose paper size by PDF page size" option, which will print on those sizes of paper respectively.
In this case, I have documents that are Letter, A4, A3, 11x17, 24x36, etc.
All of the regular-size documents (9x12 and below) would get printed on letter, while everything greater than 9x12 would get printed on 11x17.
Instead of opening each file individually and switching between the two page sizes constantly, I was wondering if there is a program or filter that could go through the document, check the sizes, and then print accordingly.
Thank you for your help!
You could set up an Action in Acrobat, running a JavaScript which evaluates the cropbox dimensions for every page of the document, and then sets the printParams accordingly, and finally prints using the printParams.
The "boxes" dimensions are also available to the (limited) scripting capabilities of the application (on Mac, using Applescript), which would allow to set up a control file you could run.
I found there is a lot of tools available for breaking the Big PDF files into smaller one by splitting the original PDF file PAGE WISE.for example, if i have a 10 page PDF Document,then we can able to break the original pdf file into 10 pieces in page wise splitting.
But i want similar kind of tool that breaks the PDF file smaller than the Page wise splitting.That means,i need to split the PDF page into different documents based on any parameter like paragraph,section,element...
for example,
If my PDF file having 2 pages with 10 paragraphs then i would like to split the pdf file into 10 separate Pdf file based on paragraph parameter...
Also, I strongly believe pdf does not contain any structure like Open XML.But i also Suspecting
How the tools can able to break the pdf files in to small pdf files by splitting page wise? What kind of mechanism they are using for page wise splitting PDF File?
So, Is there any way to do my work? Please give me your valuable suggestion on this?
PDF is a vector based document description language. It's page based so in a way every page is independent from the next one. Splitting page wise is therefore pretty easy. Contrary to a raster image where you can extract small subsets independently in a pdf you have to render the whole page to know how a small subset looks like.
Say you have a Page (black) which contains a complex shaped object (here it is a line but it could be any text, shape, image, etc.) and you want to extract a subset (red). You would have to first find all the objects that produce visible output in the region of interest. Then you would have to modify them so they are rendered correctly (in this case calculate the green points from the blue points while preserving the shape of the object).
An easier approach would be to include the whole page and clip the viewing area to the dimensions of the region.
You could do this with pdfjam. Check the --trim/--offset/--delta command in conjunction with a custom paper size (Example 6,7 on the pdfjam website). You would still have to somehow calculate the coordinates of the region of interest though.