Re: [gentoo-user] Scanning double sided documents and printing them the same.

2020-12-10 Thread J. Roeleveld
On 10 December 2020 16:37:31 CET, Rich Freeman  wrote:
>On Wed, Dec 9, 2020 at 7:09 PM Dale  wrote:
>>
>> How do I print them the
>> same way tho?
>
>I didn't see much discussion on the printing side of this - how to
>print two-sided on a one-sided printer.
>
>Step 1 (optional): I created a CUPS queue for such jobs that just
>outputs everything into PDF in a directory.  This lets you easily
>print stuff that isn't already PDF from various computers/OSes and
>accumulate a bunch as printing this way is easier in bulk since it
>involves a bit of manual manipulation.
>
>Step 2 (optional): I have a script that takes each PDF and adds a
>blank page if needed to result in an even number of pages, then
>concatenates all the PDFs into a single file.  I probably stole this
>from somewhere:
>
>#!/bin/bash
>for file in *.pdf
>do
>  #get the number of pages
>  numberofpages=`pdftk "$file" dump_data | sed -e
>'/NumberOfPages/!d;s/NumberOfPages: //'`
>  echo -n "$file" 'has' $numberofpages 'pages, '
>
>  uneven=$(($numberofpages % 2))
>  if [ $uneven == 1 ]
>  then
>echo 'which is uneven - added 1 more'
>tempfile=`mktemp`
>pdftk A="$file" B=/usr/local/share/blank.pdf cat A B1 output
>"$tempfile"
>mv $tempfile $file
>  else
>echo 'which is even'
>  fi
>done
>
>pdftk *.pdf cat output out.pdf
>
>Step 3: To print a single PDF double-sided follow this guide:
>http://duramecho.com/ComputerInformation/HowToDoTwoSidedPrinting/index.html
>
>So the idea is that I accumulate a bunch of documents to print this
>way, combine them such that they can be printed all at once, and then
>do the page flip technique in that guide.  No need to worry about
>individual pages as long as you ID which type of printer you have and
>follow the appropriate process.  However, to print multiple documents
>at once this way they all have to have an even number of pages, which
>is why I have the script.  Concatenating the files with blank pages
>added means that you can just print the whole thing once, flip, then
>print it again, and it all works.

I used to do that manually.
Printing from PDF is supported by my printer directly from USB stick, so never 
did have to play around with scripts like that.

They may come in handy in future though.

--
Joost
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.



Re: [gentoo-user] Scanning double sided documents and printing them the same.

2020-12-10 Thread Rich Freeman
On Wed, Dec 9, 2020 at 7:09 PM Dale  wrote:
>
> How do I print them the
> same way tho?

I didn't see much discussion on the printing side of this - how to
print two-sided on a one-sided printer.

Step 1 (optional): I created a CUPS queue for such jobs that just
outputs everything into PDF in a directory.  This lets you easily
print stuff that isn't already PDF from various computers/OSes and
accumulate a bunch as printing this way is easier in bulk since it
involves a bit of manual manipulation.

Step 2 (optional): I have a script that takes each PDF and adds a
blank page if needed to result in an even number of pages, then
concatenates all the PDFs into a single file.  I probably stole this
from somewhere:

#!/bin/bash
for file in *.pdf
do
  #get the number of pages
  numberofpages=`pdftk "$file" dump_data | sed -e
'/NumberOfPages/!d;s/NumberOfPages: //'`
  echo -n "$file" 'has' $numberofpages 'pages, '

  uneven=$(($numberofpages % 2))
  if [ $uneven == 1 ]
  then
echo 'which is uneven - added 1 more'
tempfile=`mktemp`
pdftk A="$file" B=/usr/local/share/blank.pdf cat A B1 output "$tempfile"
mv $tempfile $file
  else
echo 'which is even'
  fi
done

pdftk *.pdf cat output out.pdf

Step 3: To print a single PDF double-sided follow this guide:
http://duramecho.com/ComputerInformation/HowToDoTwoSidedPrinting/index.html

So the idea is that I accumulate a bunch of documents to print this
way, combine them such that they can be printed all at once, and then
do the page flip technique in that guide.  No need to worry about
individual pages as long as you ID which type of printer you have and
follow the appropriate process.  However, to print multiple documents
at once this way they all have to have an even number of pages, which
is why I have the script.  Concatenating the files with blank pages
added means that you can just print the whole thing once, flip, then
print it again, and it all works.

-- 
Rich



Re: [gentoo-user] Scanning double sided documents and printing them the same.

2020-12-10 Thread J. Roeleveld
Please do not include me in list-replies. I am subscribed.


On Thursday, December 10, 2020 11:49:06 AM CET Dr Rainer Woitok wrote:
> Joost,
> 
> On Thursday, 2020-12-10 10:28:05 +0100, you wrote:
> > ...
> > My old printer/scanner can scan directly to PDF using the sheetfeeder.
> > For double-sided, I always ended up with 1 PDF with odd-pages and 1 with
> > even.
> > 
> > There used to be tools available (python-old) that could shuffle these
> > together and merge them into a single PDF, which would allow for easy
> > reading/ printing.
> 
>$ pdftk odd.pdf even.pdf shuffle output all.pdf
> 
> Command "pdftk" comes with package "app-text/pdftk".
> 
> Sincerely,
>   Rainer

That's a java-port of the original pdftk.
I actually solved the issue by getting a double-sided ADF scanner.

--
Joost





Re: [gentoo-user] Scanning double sided documents and printing them the same.

2020-12-10 Thread Dr Rainer Woitok
Joost,

On Thursday, 2020-12-10 10:28:05 +0100, you wrote:

> ...
> My old printer/scanner can scan directly to PDF using the sheetfeeder.
> For double-sided, I always ended up with 1 PDF with odd-pages and 1 with even.
> 
> There used to be tools available (python-old) that could shuffle these 
> together and merge them into a single PDF, which would allow for easy reading/
> printing.

   $ pdftk odd.pdf even.pdf shuffle output all.pdf

Command "pdftk" comes with package "app-text/pdftk".

Sincerely,
  Rainer



Re: [gentoo-user] Scanning double sided documents and printing them the same.

2020-12-10 Thread J. Roeleveld
On Thursday, December 10, 2020 1:09:29 AM CET Dale wrote:
> Howdy,
> 
> I have a flatbed scanner.  It's a old HP 4570.  I been using Skanlite to
> scan pictures etc and it does a great job.  On occasion tho I have a
> double sided document.  I know how to scan them, scan one side, flip
> over and scan the back.  That's easy enough.  How do I print them the
> same way tho?  Sometimes I use it like a copying machine basically. 
> Scan in, then print.  I'm not quite sure how to print the double sided
> stuff in one go tho. 
> 
> If someone does the same as me, can you share how you print them two
> sided?  My printer is duplex so I just need to import both sides and
> tell it to print.  I'm just not sure what software does that and makes
> it easy.
> 
> Thoughts??
> 
> Dale
> 
> :_)  :-) 

My old printer/scanner can scan directly to PDF using the sheetfeeder.
For double-sided, I always ended up with 1 PDF with odd-pages and 1 with even.

There used to be tools available (python-old) that could shuffle these 
together and merge them into a single PDF, which would allow for easy reading/
printing.

Currently, I would have to manually convert these to single-pages and then 
merge them, again, manually.

This is the downside of single-sided sheetfeeders.

If you do the scans manually (eg. no sheetfeeders) you should be able to get 
them all in the correct order in a PDF. The PDF can then be printed double-
sided and you get them the same way. (Just scan them "dummy-mode" and add 
white-pages when the back of the sheet is white)

--
Joost






Re: [gentoo-user] Scanning double sided documents and printing them the same.

2020-12-10 Thread Neil Bothwick
On Thu, 10 Dec 2020 09:20:22 +, Michael wrote:

> > Gscan2pdf has lots of nice features, I used to use it with an ADF and
> > it would scan all the sheets, then I'd turn the stack over and feed
> > it back in and it would scan the other sides and then put all the
> > pages in the correct order.
> > 
> > I have a duplex scanner now, but that was a real time saver.  
> 
> Alternatively, on the CLI you could use imagemagick to convert your
> png, tiff, jpg, etc., to pdf:
> 
> convert scan1.png scan1.pdf
> convert scan2.png scan2.pdf
> 
> Then join the two pdf documents into one with two pages, using
> poppler's pdfunite:
> 
> pdfunite scan1.pdf scan2.pdf scanned.pdf
> 
> Then print them.
> 
> A simple script could batch up the conversion for you, e.g.:
> 
> for file in $(ls -t *.png | head -8); do
>convert $file $file.pdf
> done
> 
> The above will convert 8 png files to pdf, which you can then pdfunite
> into a single multipage pdf document before you print it.

That's pretty much what I used to do. The nice thing about gscan2pdf's
way of doing it is that it copes with the second sides being scanned in
reverse order if you use an ADF. You could script that, but when someone
has already done it, laziness... I mean efficiency, wins.


-- 
Neil Bothwick

Anything is possible if you don't know what
you are talking about.


pgpO9dT_PJw1X.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] Scanning double sided documents and printing them the same.

2020-12-10 Thread Michael
On Thursday, 10 December 2020 08:27:33 GMT Neil Bothwick wrote:
> On Wed, 9 Dec 2020 18:09:29 -0600, Dale wrote:
> > I have a flatbed scanner.  It's a old HP 4570.  I been using Skanlite to
> > scan pictures etc and it does a great job.  On occasion tho I have a
> > double sided document.  I know how to scan them, scan one side, flip
> > over and scan the back.  That's easy enough.  How do I print them the
> > same way tho?  Sometimes I use it like a copying machine basically. 
> > Scan in, then print.  I'm not quite sure how to print the double sided
> > stuff in one go tho. 
> > 
> > If someone does the same as me, can you share how you print them two
> > sided?  My printer is duplex so I just need to import both sides and
> > tell it to print.  I'm just not sure what software does that and makes
> > it easy.
> 
> I use gscan2pdf, although it sans to many more file formats. Scan to  2
> page PDF and your printer can print in duplex.
> 
> Gscan2pdf has lots of nice features, I used to use it with an ADF and it
> would scan all the sheets, then I'd turn the stack over and feed it back
> in and it would scan the other sides and then put all the pages in the
> correct order.
> 
> I have a duplex scanner now, but that was a real time saver.

Alternatively, on the CLI you could use imagemagick to convert your png, tiff, 
jpg, etc., to pdf:

convert scan1.png scan1.pdf
convert scan2.png scan2.pdf

Then join the two pdf documents into one with two pages, using poppler's 
pdfunite:

pdfunite scan1.pdf scan2.pdf scanned.pdf

Then print them.

A simple script could batch up the conversion for you, e.g.:

for file in $(ls -t *.png | head -8); do
   convert $file $file.pdf
done

The above will convert 8 png files to pdf, which you can then pdfunite into a 
single multipage pdf document before you print it.


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Scanning double sided documents and printing them the same.

2020-12-10 Thread Neil Bothwick
On Wed, 9 Dec 2020 18:09:29 -0600, Dale wrote:

> I have a flatbed scanner.  It's a old HP 4570.  I been using Skanlite to
> scan pictures etc and it does a great job.  On occasion tho I have a
> double sided document.  I know how to scan them, scan one side, flip
> over and scan the back.  That's easy enough.  How do I print them the
> same way tho?  Sometimes I use it like a copying machine basically. 
> Scan in, then print.  I'm not quite sure how to print the double sided
> stuff in one go tho. 
> 
> If someone does the same as me, can you share how you print them two
> sided?  My printer is duplex so I just need to import both sides and
> tell it to print.  I'm just not sure what software does that and makes
> it easy.

I use gscan2pdf, although it sans to many more file formats. Scan to  2
page PDF and your printer can print in duplex.

Gscan2pdf has lots of nice features, I used to use it with an ADF and it
would scan all the sheets, then I'd turn the stack over and feed it back
in and it would scan the other sides and then put all the pages in the
correct order.

I have a duplex scanner now, but that was a real time saver.


-- 
Neil Bothwick

Evolution stops when stupidity is no longer fatal!


pgpZscMjPlg21.pgp
Description: OpenPGP digital signature


Re: [gentoo-user] Scanning double sided documents and printing them the same.

2020-12-09 Thread Dale
the...@sys-concept.com wrote:
> On 12/09/2020 05:46 PM, the...@sys-concept.com wrote:
>> On 12/09/2020 05:09 PM, Dale wrote:
>>> Howdy,
>>>
>>> I have a flatbed scanner.  It's a old HP 4570.  I been using Skanlite to
>>> scan pictures etc and it does a great job.  On occasion tho I have a
>>> double sided document.  I know how to scan them, scan one side, flip
>>> over and scan the back.  That's easy enough.  How do I print them the
>>> same way tho?  Sometimes I use it like a copying machine basically. 
>>> Scan in, then print.  I'm not quite sure how to print the double sided
>>> stuff in one go tho. 
>>>
>>> If someone does the same as me, can you share how you print them two
>>> sided?  My printer is duplex so I just need to import both sides and
>>> tell it to print.  I'm just not sure what software does that and makes
>>> it easy.
>>>
>>> Thoughts??
>>>
>>> Dale
>>>
>>> :_)  :-) 
>>>
>> Do you use XSane  to scan it?  You setup the printer in Setup menu under
>> "Copy" and scan in duplex mode.  If you printer is setup by default to
>> print duplex it will print it correctly, in duplex.  If not you will get
>> two pages, it prints directly to a printer (the print windows doesn't
>> pop-up).
>>
>> I suggest to scan it first to a document and print it in duplex.
> Correction. You have mentioned it is a flatbed scanner so you can not
> scan in duplex mode.  Just create "multipage document" scan both sides,
> save it and you should be able to print it in duplex mode.  I mostly use
> PDF format for documents.
>
>
>


Since I was wanting to get a copy made somewhat quick, I used
Libreoffice, LOo, to do it a bit ago.  Thing is, it takes a bit to get
it to size correctly.  It wants to shrink it and it is stubborn about
doing it that way.  I just don't know of a easier way so I asked.  I
figure there is a tool for this. 

I have XSane installed but only used it a couple times.  Skanlite was so
much quicker and easier to use that I stuck with it.  I tried XSane and
I see a option for multi-page documents.  I may play with that and see
how it does. 

Another reason I'd like to be able to do this, pictures with names etc
on the back.  It would be nice to get both the front and back of those. 
Just need a easy tool to do it with.  Maybe I can get XSane to do this
too. 

Still open to ideas.  Thanks for the info tho.  ;-D

Dale

:-)  :-) 



Re: [gentoo-user] Scanning double sided documents and printing them the same.

2020-12-09 Thread thelma
On 12/09/2020 05:46 PM, the...@sys-concept.com wrote:
> On 12/09/2020 05:09 PM, Dale wrote:
>> Howdy,
>>
>> I have a flatbed scanner.  It's a old HP 4570.  I been using Skanlite to
>> scan pictures etc and it does a great job.  On occasion tho I have a
>> double sided document.  I know how to scan them, scan one side, flip
>> over and scan the back.  That's easy enough.  How do I print them the
>> same way tho?  Sometimes I use it like a copying machine basically. 
>> Scan in, then print.  I'm not quite sure how to print the double sided
>> stuff in one go tho. 
>>
>> If someone does the same as me, can you share how you print them two
>> sided?  My printer is duplex so I just need to import both sides and
>> tell it to print.  I'm just not sure what software does that and makes
>> it easy.
>>
>> Thoughts??
>>
>> Dale
>>
>> :_)  :-) 
>>
> 
> Do you use XSane  to scan it?  You setup the printer in Setup menu under
> "Copy" and scan in duplex mode.  If you printer is setup by default to
> print duplex it will print it correctly, in duplex.  If not you will get
> two pages, it prints directly to a printer (the print windows doesn't
> pop-up).
> 
> I suggest to scan it first to a document and print it in duplex.

Correction. You have mentioned it is a flatbed scanner so you can not
scan in duplex mode.  Just create "multipage document" scan both sides,
save it and you should be able to print it in duplex mode.  I mostly use
PDF format for documents.




Re: [gentoo-user] Scanning double sided documents and printing them the same.

2020-12-09 Thread thelma
On 12/09/2020 05:09 PM, Dale wrote:
> Howdy,
> 
> I have a flatbed scanner.  It's a old HP 4570.  I been using Skanlite to
> scan pictures etc and it does a great job.  On occasion tho I have a
> double sided document.  I know how to scan them, scan one side, flip
> over and scan the back.  That's easy enough.  How do I print them the
> same way tho?  Sometimes I use it like a copying machine basically. 
> Scan in, then print.  I'm not quite sure how to print the double sided
> stuff in one go tho. 
> 
> If someone does the same as me, can you share how you print them two
> sided?  My printer is duplex so I just need to import both sides and
> tell it to print.  I'm just not sure what software does that and makes
> it easy.
> 
> Thoughts??
> 
> Dale
> 
> :_)  :-) 
> 

Do you use XSane  to scan it?  You setup the printer in Setup menu under
"Copy" and scan in duplex mode.  If you printer is setup by default to
print duplex it will print it correctly, in duplex.  If not you will get
two pages, it prints directly to a printer (the print windows doesn't
pop-up).

I suggest to scan it first to a document and print it in duplex.