custom paper size for labelprinter (Brother QL 570) - printing

I have a new label printer (Brother QL 570) wich supports endless paper. My thought was, that I will be able to save paper by printing just as much paper as I need - wrong!
The printer comes with paper sizes of 63mm x 100mm and 63mm x 29mm (and some others) but I need 63mm x 'felxible lenght' or something like 63mm x 40mm.
How can I change that? I will print from OpenOffice.
Thanks!
(Driver is CUPS, using Mint 17.1)

The CUPS drivers that come with the printer include a utility for adding custom paper sizes.
Open a terminal and type:
brpapertoollpr_ql570
And you will see the usage examples for adding and removing custom sizes:
===========================
LPRng Paper Size Tool (v 0.1) Copyright by 2005
Usage: brpapertoollpr_xxxx -P QL-xxxx Printer Name [-n add a Lable Format Name (<=32 bytes) -w Media Width(unit:mm) -h Media Height(unit:mm)]/[-d delete Lable Format Name]
For example:
1. Add a new Label Format with "New Label Format" name and 29mm width and 70mm length:
"brpapertoollpr_ql570 -P QL-570 -n New\ Label\ Format -w 29 -h 70" [enter]
2. Remove the Label Format with "New Label Format" name:
"brpapertoollpr_ql570 -P QL-570 -d New\ Label\ Format" [enter]
===========================
As an example, I did
brpapertoollpr_ql570 -P QL-570 -n long_label -w 62 -h 200
to set up a custom paper size called "long_label" which prints on 62mm continuous roll, a 200mm long label

Related

Printing really long prints on Epson Thermal Printers

Working on a project where I'm printing really long prints on epson thermal printers (80mm x 18000mm) (length is variable per print).
My documents are set up as 1000mm long pages ie 14000mm print is 14 pages.
I'm able to print a correct length document with this command
lp -d 10_0_0_11 -o media=Custom.80x18000mm -o PageSize=Custom.80x1000mm -o TmtPaperSource=DocNoFeedCut -o landscape -o fit-to-page -o outputorder=reverse -o TmtSpeed=1 -o TmtPaperReduction=Both example/url/to/document
But this is really slow and don't want to use the command line for convenience.
When printing the document via Preview MacOS it only prints a portion of the document at the printer's max print size of 80x297mm. I have a custom page size of 80x1000mm setup but it seems to be ignoring that.
Any better workaround to gain the extra speed printing without the command line?

How to create a blank but valid EPS?

One of our printing applications runs an external program which does some magic and sometimes returns a barcode in EPS format to be printed on the document.
if [ ... some magic ]
then
gnu-barcode -b $1 -c -e code39 -u mm -t 1x3 > $TMP.ps
ps2epsi $TMP.ps $TMP.eps
cat $TMP.eps
rm -f $TMP.eps $TMP.ps
else
cat /dev/null
fi
This works OK. However, it generates an annoying warning on the printing application side about not receiving a valid EPS when the else ... runs and we do cat /dev/null. I need to return a blank but valid EPS instead of the cat /dev/null. How can I accomplish this?
The EPS format is defined in Adobe Technical note 5002, its available on the web but it moves around so much I won't attempt to post a URL. However, unless you are a PostScript programmer that probably won't help you.
The simplest possible valid EPS would be something like:
%!PS-Adobe-2.0 EPSF-3.0
%%BoundingBox:0 0 0 0
That's the only required content in an EPSF. Of course, a real printing application might not like a BoundingBox of 0 0 0 0.

Capture information on images generated by ImageMagick

I'm considering using ImageMagick to extract images from individual pages from a PDF file. How can I capture the names of the files getting generated by it? It seems that the -verbose option includes information on the files getting generated, but is that a reliable way of gathering that? Any other alternatives?
Depending on what you want to do, I think you have at least 3 options...
Option 1
If you want to know the number of pages up front, a priori, you can get ImageMagick to tell you like this:
identify -format %n FreddyFrog.pdf
8
or if you want it in a variable,
pages=$(identify -format %n FreddyFrog.pdf)
echo $pages
8
Option 2
You can tell ImageMagick how to format the names of the output files, like this, where the %04d says to use 4 digits and front-pad with zeroes:
convert -density 72 FreddyFrog.pdf FreddyFrog-%04d.tif
Then you will automatically know the names of the output files.
ls FreddyFrog-*
FreddyFrog-0000.tif FreddyFrog-0003.tif FreddyFrog-0006.tif
FreddyFrog-0001.tif FreddyFrog-0004.tif FreddyFrog-0007.tif
FreddyFrog-0002.tif FreddyFrog-0005.tif
Option 3
You can use the shell to draw a line in the sand before you convert the files and then find everything newer afterwards:
> before # or "touch before" if you prefer
convert FreddyFrog..... # strut your IM stuff
for f in *; do [[ "$f" -nt before ]] && echo $f; done # list files newer than line in sand
rm before # clean up
rm before

ImageMagick pdf to black and white pdf

I would like to convert a pdf file to a Black and White PDF file with ImageMagick. But I've got two problems:
I use this command:
convert -colorspace Gray D:\in.pdf D:\out.pdf
But this command convert only the FIRST page... How to convert all pages?
After use this command the resolution is terrible... but if I use -density 300 option the file size has increased more than double. So I would like to use the same DPI setting, but how to use?
Thanks a lot
Assuming you have all the necessary command line tools installed you can do the following:
Split and join PDF using pdfseparate and pdfunite (Poppler tools).
Extract the original density using pdfinfo plus grep/egrep and, for instance, sed. This will not guarantee the same size of the PDF file, just the same DPI.
Putting it all together you can have a series of bash commands as following:
pdfseparate in.pdf temp-%d.pdf; for i in $(seq $(ls -1 temp-*.pdf | wc -l)); do mv temp-$i.pdf temp-$(printf %03d $i).pdf; done
for f in temp-*.pdf; do convert -density $(pdfinfo $f | egrep -o 'Page size:[[:space:]]*[0-9]+(\.[0-9]+)?[[:space:]]*x[[:space:]]*[0-9]+(\.[0-9]+)?' | sed -e 's/^Page size:\s*//'| sed -e 's/\s*x\s*/x/') -colorspace Gray {,bw-}$f; done
pdfunite bw-temp-*.pdf out.pdf
rm {bw-,}temp-*.pdf
Note 1: there as a dirty workaround (for/wc/seq/printf) for a proper ordering of 10-999 pages PDFs (I did not figure out how to put leading zeros in pdfseparate).
Note 2: I guess ImageMagick treats PDFs as just another binary image file so for instance for mainly text files this will result in huge PDFs. Thus, this is a very bad method to convert text-based PDFs to B&W.

How to print Java code on A3 page avoiding line-wrapping

I have to print Java code that some times reaches 300 columns (characters per line) in A3 paper and whatever editor I use (e.g. textmate) wraps the lines in order to fit in A4 paper.
Any suggestions?
cheers,
Asterios
Your editor undoubtably has either a Page Setup dialog or a Preferences dialogue as part of the Print Dialogue which will allow you to set the Paper Size to use for printing.
Even Notepad supports this
I finally made it to print using enscript. Here is the command I used to print Java code into PDF (and the used the pdf to print).
enscript -r -Ejava -M A3 -C -f "Courier8" input.java -o - | ps2pdf - output.pdf
where:
-r prints in landscape mode
-C prints the line numbers
-f changes the font and size
-M sets the output media to A3 (default is A4)
-Ejava adds syntax highlighting (you can also use --color if you need
colors in syntax highlighting but
they are not nicely printed in
greyscale)
It seems unlikely that every editor tries to format for A4. Which other editors have you tried? Does textmate not have a page size option? (Hmm... seems not)
Try a different editor that does let you set page size. Word, even.

Resources