LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-26-2013, 02:33 PM   #1
barnarasta
Member
 
Registered: Oct 2012
Location: Spain
Distribution: Debian Squeeze-Wheezy-Jessie \/ Unix SCO 5.7. in production, not for play.
Posts: 30

Rep: Reputation: 0
CUPS create PDF with ESC/P


Good afternoon,
I commented that I have a request from a client to create a PDF file for subsequent delivery to "mutt".
The scenario is as follows:
Wheezy server without graphical desktop, text-only console.
installed CUPS
............... Virtual_PDF printer with driver Generic CUPS-PDF
............... Epson-LQ-2090 /dev/lp0 driver EPSON 24-Pin
...............HP LaserJet P3015 socket ://192.1.80.10 driver Foomatic/ljet4
............... Epson-FX-890 (with printserver D-LINK) lpd ://192.1.80.60/lpt1 driver Epson 24-pin
.............. Canon multifunction socket ://192.1.80.101 driver imageRunner 2270Foomatic/pxlmono

The sales application sends the result of printing to /tmp/xxxxx.lpd (xxxxxx are numbers).

Editing a file can be viewed using Escape Codes that are defined for each printer.
Code:
^R^[W^A RESUMEN de VENTAS  SEMANA     38 ^[W^@
As an example, I put codes settings for EPSON-LQ-2090
Code:
Configure printer = ESC,@
Top of form = ^L
Start underline = ESC,-,^A
End underline = ESC,-,NULL
Print double width = ESC,W,^A
Print single width = ESC,W,NULL
Print enhanced characters = ESC,G
Print ordinary characters = ESC,H
Set alternate character set = ESC,4
Set standard character set = ESC,5
Standard page length = 66
Standard page width = 132
--------------------------------
The printing process ends with the execution of: lpr -P Epson-LQ-2090 /tmp/xxxxx.lpd
================================================== ===============================
To create the PDF file requested instruction perform lpr -P Virtual_PDF /tmp/xxxx.lpd
and I create a document xxxxx.pdf but totally blank.
"Gogleando" and doing some testing for days, I got out a xxxxx.pdf with the information
- Leave all settings blank checks -
and logically in the document there is no difference with header, underline or enhanced.

Maybe with some filters could solve the problem?
How could I solve the problem?
Maybe with PJL or PCL codes? , Anyone knows?

thanks

Last edited by barnarasta; 09-26-2013 at 02:42 PM.
 
Old 09-26-2013, 06:24 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,949

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
Basically cups-pdf is a Postscript to PDF converter. So using an Epson ESC/P raw print output file will not work. So what legacy application are you running?

Postscript would not require a filter. You could convert PCL to PS to PDF via ghostscript's ghostpcl and then print using the virtual printer.
 
Old 09-27-2013, 04:41 AM   #3
barnarasta
Member
 
Registered: Oct 2012
Location: Spain
Distribution: Debian Squeeze-Wheezy-Jessie \/ Unix SCO 5.7. in production, not for play.
Posts: 30

Original Poster
Rep: Reputation: 0
Thanks "michaelk" for your contribution,
an application is being used in SCULPTOR-4GL and the reason for using EPSON & raw is the need to print 4 copies (chemical-paper) 200 delivery notes aprox. in a few minutes.
The idea is to make sending e @ mail a copy to the receiver before the goods arrive.
It is okay to make a defining internal printing a PCL printer and later PS ==> PDF.
But unknown to the PCL codes for:
Code:
 Configure printer = ???????
Top of form = ??????
Start underline = ??????
End underline = ??????
Print double width = ??????
Print single width = ?????
Print enhanced characters = ?????
Print ordinary characters = ?????
Set alternate character set = ?????
Set standard character set = ??????
Standard page length = ?????
Standard page width = ???
As I mentioned above, if I empty the printing codes works, but does not perform underline, compress, enhaced ........
Not is necessary to include pictures, but a minimum of proper presentation.

Thanks for the help
 
Old 09-27-2013, 05:36 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,949

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
Where do you put the codes?
 
Old 09-27-2013, 07:15 AM   #5
barnarasta
Member
 
Registered: Oct 2012
Location: Spain
Distribution: Debian Squeeze-Wheezy-Jessie \/ Unix SCO 5.7. in production, not for play.
Posts: 30

Original Poster
Rep: Reputation: 0
I can define the codes within the same SCULPTOR-4GL, specifically in the /usr/SCULPTOR/printers for the application using the definition of the desired printer.
Inside that directory I have:
Code:
-rw-rw-rw- 1 sculptor sculptor 1478 sep 25 19:20 canon4051.s
-rw-rw-rw- 1 sculptor sculptor 1036 jul 31  2012 citoh.s
-rw-rw-rw- 1 sculptor sculptor 1020 jul 30  2012 dre8820.s
-rwxr-xr-x 1 sculptor sculptor 1048 oct 15  2007 epsonfx219.s
-rwxrwxrwx 1 sculptor sculptor 1069 sep 18  2012 epsonfx880.s
-rwxrwxrwx 1 sculptor sculptor 1103 sep 18  2012 epsonfx890.s
-rwxrwxrwx 1 sculptor sculptor 1068 nov  4  2005 epsonlq2090.s
-rw-rw-rw- 1 sculptor sculptor 1129 sep 18  2012 epsonlq.s
-rw-r--r-- 1 sculptor sculptor 1058 may 21  2008 epsonlx300.s
-rw-rw-rw- 1 sculptor sculptor 1045 jul 31  2012 epsonlx.s
-rw-rw-rw- 1 sculptor sculptor 1196 sep 18  2012 epson.s
-rw-rw-rw- 1 sculptor sculptor 1093 jul 31  2012 epsonsq.s
-rw-rw-rw- 1 sculptor sculptor  961 jul 30  2012 f8030pr.s
-rw-rw-rw- 1 sculptor sculptor 1037 jul 30  2012 fx_100.s
-rw-rw-rw- 1 sculptor sculptor 1437 jul 31  2012 hp2055.s
-rw-rw-rw- 1 sculptor sculptor 1437 jul 31  2012 hp3015.s
-rw-rw-rw- 1 sculptor sculptor 1414 jul 31  2012 nashua.s
-rw-rw-rw- 1 sculptor sculptor 1043 jul 30  2012 ndr_132.s
-rw-rw-rw- 1 sculptor sculptor 1039 jul 30  2012 ndr_80.s
-rw-rw-rw- 1 sculptor sculptor 1043 jul 30  2012 nec_p5.s
-rwxrwxrwx 1 sculptor sculptor 1045 jul 31  2012 oki.s
-rw-rw-rw- 1 sculptor sculptor  894 ene 18  2013 pvdu.s
-rw-rw-rw- 1 sculptor sculptor  910 jul 30  2012 ricoh.s
-rw-rw-rw- 1 sculptor sculptor 1026 jul 30  2012 star.s
-rw-rw-rw- 1 sculptor sculptor 1032 jul 30  2012 toshiba351.s
-rw-rw-rw- 1 sculptor sculptor 1216 jul 30  2012 wenger.s
but I can create a new printer name to be used copying and printing codes changing.

Any idea of the way forward?
I'm looking to incorporate POSTSCRIPT codes and do some testing.

thanks

Last edited by barnarasta; 09-27-2013 at 07:16 AM.
 
Old 09-27-2013, 07:34 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,949

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
Try using the HP3015 instead of the Epson since it supports Postscript.
 
Old 09-28-2013, 06:14 AM   #7
barnarasta
Member
 
Registered: Oct 2012
Location: Spain
Distribution: Debian Squeeze-Wheezy-Jessie \/ Unix SCO 5.7. in production, not for play.
Posts: 30

Original Poster
Rep: Reputation: 0
Yes! ,is true, POSTSCRIPT supports HP3015 , but only when printing from OpenOficce or similar.
I know Applications the result of the impression is released first as 'RTF' to OpenOficce and prints, but in my case, and I guess hundreds of them, would be very slow to review the output of a printing of 200 invoices at the same time .
The printing on HP3015 performed with the "raw" and the following internal codes:
Code:
Configure printer = ESC,&,l,2,6,A,ESC,&,k,3,G,ESC,&,a,1,L,ESC,(,3,@,ESC,&,l,8,D,
ESC,(,s,0,P
Top of form = ^L
Start underline = ESC,&,d,0,D
End underline = ESC,&,d,@
Print double width = ESC,(,s,5,H
Print single width = ESC,&,k,0,S
Print enhanced characters = ESC,(,s,4,B
Print ordinary characters = ESC,(,s,0,B
Set alternate character set = ESC,(,s,1,9,H
Set standard character set = ESC,&,k,0,S
Standard page length = 88
Standard page width = 75
Now I'm watching "LATEX" and documentation of creating PDF,

but I'm beginning to think that is an incredibly impossible project, but I find it strange to think that there is a filter for ESC / P to PDF, I think as my case must be hundreds.

Thank you for time and help.

Last edited by barnarasta; 09-28-2013 at 06:19 AM.
 
Old 09-28-2013, 07:25 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,949

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
So the application appears to output ESC/P no matter what printer is selected. I don't know of anything that will convert to PS or PDF. For a similar project I ended up writing my own "filter" using PHP and FPDF to create my own PDFs.
 
Old 12-16-2013, 01:18 PM   #9
mlivadiotis
LQ Newbie
 
Registered: Dec 2013
Posts: 1

Rep: Reputation: Disabled
Sculpto 4GL

I am an old Sculptor programmer. Twenty years later I was given some sculptor database files which I was asked to export to text.
However they have Greek texts in some of the fields and when I run my program the greek characters dont show.

I have tried to run my program using nullp but still no luck.
When I run the program on the screen the Greek characteers show fine.
i.e. sagrep myprogram {greek chararcters show perfectly on the screen.
But when trying to append on a text file
sagerep myprogram nullp > textfile.txt {Greek chararcters dont display}
000000000001 001 500g MAIN STORE

Can someone let me know what should I do to export my data into text file??

Michael
 
  


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
Firefox print to PDF (and CUPS) only saves the first 1 or 2 pages to PDF ziphem Linux - Software 1 05-08-2011 11:43 PM
cups-pdf in OpenSuse 11.2 doesn't create pdf zorro_kwh Linux - Newbie 2 03-09-2011 11:53 AM
How to wget a webpage, and save as PDF (like cups-pdf) ? frenchn00b Programming 3 11-18-2008 04:48 PM


All times are GMT -5. The time now is 10:48 AM.

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