LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-05-2010, 02:58 PM   #1
smason
LQ Newbie
 
Registered: Jun 2010
Posts: 3

Rep: Reputation: 0
Print data to laser printer using an overlay form and save file as pdf


ok. i've done lot's of reading and still not able to find an answer or solution, so here goes.. i have custom programs written in Basis pro5. Standard output to a pdf virtual printer works fine. Using pdftk to overlay on to a form is hit or miss.... There are products out there like Unform that are just too expensive for my company. i have purchased another product from a company that prints the forms to the laser perfectly but i am incapable of capturing them and saving them as pdf's for archiving/emailing/faxing and i don't much care for this company.
if anyone has any recomendations i would love to hear them.... i might ever consider hiring someone to write the needed script(s).

Thank you!
 
Old 06-11-2010, 09:23 AM   #2
smason
LQ Newbie
 
Registered: Jun 2010
Posts: 3

Original Poster
Rep: Reputation: 0
no one has any solutions so i decided to post my code. maybe someone has a better solution. this code works about 50% of the time and for the life of me i can't figure out why it fails..


### overlay form onto file
INFILE=$1
FORMFILE=$2
OUTFILE=$3
#rm $OUTFILE

#NEWFILE=`cat $INFILE|cut -c24-28`
#NEWFILE=${NEWFILE/ /}

sleep 1

#NEWFILE=/var/spool/cups-pdf/$USER/job_$NEWFILE-stdin.pdf

NEWFILE=/var/spool/cups-pdf/$USER/stdin.pdf
sleep 2

pdftk $NEWFILE background $FORMFILE output $OUTFILE

lp -dpl4 $OUTFILE
rm $INFILE

quit 0
 
Old 06-21-2010, 06:41 AM   #3
smason
LQ Newbie
 
Registered: Jun 2010
Posts: 3

Original Poster
Rep: Reputation: 0
i've discovered the problem but still need help with a solution......... the resulting file after i pdftk is seeing the & and @ characters as printer escape codes when those characters are in my print data. file1.pdf has no issue ignorring those characters and prints fine. only after i pdftk file1 to background file2 out put file3 is there a problem. temporary solution is to first creat a txt file, use sed to substitute those characters so the resulting file3 can print, but i need a better solution... i have to have the & and @ characters print just as they are supposed to... anyone have an idea how to accomplish this?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hp Laser Jet 5Si printer connected through a serial port on RHEL 5 does not print arphias Linux - Hardware 5 07-24-2008 09:58 AM
CUPS PDF Printer that prompts for save location? MasterC Linux - General 3 01-11-2008 03:59 PM
Lexmark c532dn color laser printer will only print in grayscale mjkelly93 Linux - Hardware 8 01-07-2008 05:02 PM
How to print/save a bundle of .png files as a single .pdf file satimis Linux - Software 24 08-04-2007 07:05 AM
Print-to-file print driver to print PDF Bill Fox Linux - General 3 05-02-2006 05:15 PM


All times are GMT -5. The time now is 09:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration