Support for PageScript now in eXpress++

This forum is for eXpress++ general support.
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Support for PageScript now in eXpress++

#1 Post by rdonnay »

The attached file contains support for the PageScript print engine from ABEE. Create a new folder named \exp19\PSCRIPT and unzip the file into that folder.

DCPS.CH and DCPS.PRG contain commands and functions to use this excellent print engine with eXpress++ style commands. DCPS commands are similar to DCPRINT commands except they use the PSCRIPT.DLL print engine. This print engine will create PDF files and also supports bar codes. Run PBUILD PSTEST.XPJ and the run PSTEST.EXE to view the sample programs.

The commands allow usage of Xbase++ style fonts and colors. If you must have PDF output and do not want to require your users to purchase Win2PDF or BullZip, then this may be the best solution for you because PDF support is built in to the print engine.

It also includes a print previewer.
PSCRIPT.zip
(1.24 MiB) Downloaded 788 times
Here is a snapshot of the printout:
bill_of_lading.JPG
bill_of_lading.JPG (141.91 KiB) Viewed 14451 times
Here is the source code for the printout:

Code: Select all

FUNCTION ExpressStylePrint2(nDevice)

Local nLoop
Local cText := ;
  "Paradise is engineered on Vos, the hidden sister planet of Earth that " + ;
  "orbits the sun directly opposite our own planet; sirens and satyrs dance " + ;
  "to the music of love and bounty; the seer arrives to warn of the approaching " + ;
  "Dark and is ignored. Los the Irrational attempts to stifle the music; " + ;
  "the sirens and satyrs are concerned, but are too apathetic to act; the music " + ;
  "wheel on which Vos rotates grinds to a halt; the birds and insects leave " + ;
  "Paradise; the Darkness begins. Many sirens and satyrs perish in the frigid " + ;
  "Darkness; Emau stumbles across a hollow reed in the forests and creates music; " + ;
  "Los the Irrational battles Emau with Silence; Emau triumphs; light returns to Paradise."

DCPS BEGINDOC TITLE "Bill of Lading" ORIENTATION 1 PAGESIZE DMPAPER_LETTER ;
             _ACROBAT nDevice==4 

DCPS UNITS APS_MILL

// Puro Logo
@ 15, 8, 22, 50 DCPS BITMAP "PUROLOGO.BMP"

// Top/Left Two frames
@ 25, 8,  62, 100 DCPS FRAME THICKNESS 2 FILLCOLOR GRA_CLR_WHITE
@ 65, 8, 112, 100 DCPS FRAME THICKNESS 2 FILLCOLOR GRA_CLR_WHITE

@ 27, 55 DCPS SAY "SENDER (FROM)"          FONT '8.Arial' JUSTIFY APS_CENTER
@ 33, 10 DCPS SAY "AbeeLabs Systems Inc."  FONT '8.Arial Bold'
@ 37, 10 DCPS SAY "70, de la Gare Street"  FONT '8.Arial Bold'
@ 42, 10 DCPS SAY "St. Jerome, Quebec"     FONT '8.Arial Bold'
@ 51, 10 DCPS SAY "J7Z 2B8"                FONT '8.Arial Bold'
@ 56, 10 DCPS SAY "(999) 555-5555"         FONT '8.Arial Bold'

@ 67, 55 DCPS SAY "RECEIVER (TO)"          FONT '10.Arial' JUSTIFY APS_CENTER
@ 72, 10 DCPS SAY "Liza Peabody"           FONT '14.Arial Bold'
@ 78, 10 DCPS SAY "Mistral Floors Ltd."    FONT '14.Arial Bold'
@ 84, 10 DCPS SAY "2211, Industrial blvd." FONT '14.Arial Bold'
@ 95, 10 DCPS SAY "Springfield, Ill 24551" FONT '14.Arial Bold'
@101, 10 DCPS SAY "(888) 555-1111"         FONT '14.Arial Bold'

@ 10,112 DCPS SAY "PACKAGE I.D. NO."       FONT '8.Arial'
@  8,143 DCPS SAY "7 0 3  8 2 3  8 7 3 4"  FONT '16.Arial Bold'
@ 18,60  DCPS SAY "0 1 5 1 8 1 6 9 6"      FONT '14.Arial Bold'
@ 25,120 DCPS SAY "BILL CHARGES TO"        FONT '8.Arial' JUSTIFY APS_CENTER
@ 25,145 DCPS SAY "TOTAL WEIGHT"           FONT '8.Arial' JUSTIFY APS_CENTER
@ 25,170 DCPS SAY "PIECES"                 FONT '8.Arial' JUSTIFY APS_CENTER
@ 25,192 DCPS SAY "DATE"                   FONT '8.Arial' JUSTIFY APS_CENTER

@ 29,145 DCPS SAY "SUBJECT TO AUDIT"       FONT '6.Arial' JUSTIFY APS_CENTER
@ 29,192 DCPS SAY "MO  DAY  YEAR"          FONT '6.Arial' JUSTIFY APS_CENTER

@ 34,120 DCPS SAY "RECEIVER"               FONT '10.Arial Bold' JUSTIFY APS_CENTER
@ 34,145 DCPS SAY "1 POUND"                FONT '10.Arial Bold' JUSTIFY APS_CENTER
@ 34,170 DCPS SAY "1 OF 1"                 FONT '10.Arial Bold' JUSTIFY APS_CENTER
@ 34,192 DCPS SAY Date()                   FONT '10.Arial Bold' JUSTIFY APS_CENTER

@ 45,155 DCPS SAY "SERVICE OPTIONS"        FONT '11.Arial Bold Italic' JUSTIFY APS_CENTER

@109,135 DCPS SAY "PIN"                    FONT '6.Arial' JUSTIFY APS_CENTER
@108,160 DCPS SAY "7 0 3  8 2 3  8 7 3 4"  FONT '10.Arial' JUSTIFY APS_CENTER

@115, 14 DCPS SAY "UNICODE"                FONT '6.Arial' JUSTIFY APS_CENTER
@115, 60 DCPS SAY "AIRPORT CODE"           FONT '6.Arial' JUSTIFY APS_CENTER
@115, 95 DCPS SAY "SERVICE GARANTEE"       FONT '6.Arial' JUSTIFY APS_CENTER

@125, 14 DCPS SAY "32"                     FONT '36.Arial Bold' JUSTIFY APS_CENTER

@141,205 DCPS SAY "45333 4.0000426033411"  FONT '6.Arial' JUSTIFY APS_RIGHT

@143,  8 DCPS SAY "Fold this Bill of Lading on the dotted line and insert it into the labelope. Attach a Bill of Lading to each package." ;
                                             FONT '8.Arial Bold'
@112, 110 DCPS BARCODE "A7038238734" HEIGHT 64 THICKNESS 1 TYPE APS_BC39

FOR nLoop := 8 to 205 step 2
  @ 140, nLoop, 140, nLoop + 1 DCPS LINE THICKNESS 1
NEXT nLoop

@157,  8 DCPS SAY "Description :" FONT '8.Arial Bold'

@ 160, 27, 160, 115 DCPS LINE THICKNESS 1

@162,  8 DCPS SAY "No Declared Value Entered in Software By Sender" FONT '8.Arial Bold'

@176,107 DCPS SAY "TRANSPORTATION CONDITIONS"  FONT '8.Arial Bold' JUSTIFY APS_CENTER

@180, 8, 192, 205 DCPS TEXTBOX "1)  " + cText  FONT '7.Arial' THICKNESS 0
@193, 8, 205, 205 DCPS TEXTBOX "2)  " + cText  FONT '7.Arial' THICKNESS 0
@206, 8, 212, 205 DCPS TEXTBOX "3)  " + cText  FONT '7.Arial' THICKNESS 0
@213, 8, 216, 205 DCPS TEXTBOX "4)  " + cText  FONT '7.Arial' THICKNESS 0
@218, 8, 230, 205 DCPS TEXTBOX "5)  " + cText  FONT '7.Arial' THICKNESS 0
@231, 8, 238, 205 DCPS TEXTBOX "6)  " + cText  FONT '7.Arial' THICKNESS 0
@239, 8, 254, 205 DCPS TEXTBOX "7)  " + cText  FONT '7.Arial' THICKNESS 0

DCPS OFF

RETURN nil
The eXpress train is coming - and it has more cars.

skiman
Posts: 1189
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Support for PageScript now in eXpress++

#2 Post by skiman »

Hi Roger,

It seems as that product isn't supported anymore by the creator?

I will stay with DCPRINT, for which the sourcecode is available, and it is supported.

Important is also that the barcordes supported by Pagescript are only code39 and ean128. You can't print ean13 or ean8.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Support for PageScript now in eXpress++

#3 Post by rdonnay »

Chris -

The other barcodes can be handled via different fonts.
I understand your concerns about an unsupported product, however I know lots of people who are still using RMChart.
It is unsupported, but it works good and will continue to work good provided that you won't want new features.
Printing and charting, in many cases, is not much of an evolving universe and PsScript can be very handy for those who want to create PDF reports.

I have eXpress++ users who want to generate web-based reports for their customers.
With PScript and CXP, they can do this rather simply.
The eXpress train is coming - and it has more cars.

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: Support for PageScript now in eXpress++

#4 Post by hz_scotty »

I know user who bought the library a few years ago
and there was the sourcecode in the package.
best regards
Hans

Zdeno Bielik
Posts: 147
Joined: Thu Jan 28, 2010 9:24 am
Location: Nitra, Slovakia
Contact:

Re: Support for PageScript now in eXpress++

#5 Post by Zdeno Bielik »

Hi Roger,

please, if can I kindly ask you, I need help with attached example.

PRG version works OK, but I don’t know, how convert it to CXP version.
There is no PScript.LIB file, which I can add into Helpers section
and I have no idea, where and how call PScript.dll.

TIA & Regards
Zdeno
Attachments
test03.zip
(1.53 KiB) Downloaded 759 times

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Support for PageScript now in eXpress++

#6 Post by rdonnay »

I think you need to put Pscript.dll into \cxp20\bin.

Are you using Apache, IIS or WebHandler for your web server?

I am working on this code now and testing with my Apache.
I will let you know when I have something working for you.
The eXpress train is coming - and it has more cars.

Zdeno Bielik
Posts: 147
Joined: Thu Jan 28, 2010 9:24 am
Location: Nitra, Slovakia
Contact:

Re: Support for PageScript now in eXpress++

#7 Post by Zdeno Bielik »

Roger,

I use IIS now, but it will be perfecft, if it will works with CxpHttpServer too, because later I want use only it.

Zdeno

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Support for PageScript now in eXpress++

#8 Post by rdonnay »

I made the below changes to your PsTest01.cxp.
You can test it by clicking here:
http://bb.donnay-software.com/ds/pstest01.cxp

There is no project file, so the code needs to be included like this in the CXP file:

Code: Select all

#include "tpscript.prg"
#include "PSCRIPT.CH"
#include "dcps.prg"
#INCLUDE "dcps.CH"
Those files must all reside in \cxp20\include.

Pscript.dll must reside in \cxp20\bin

I'm using Apache so that is how I do it.
You may have to set it up differently for IIS.
You can probably put all those files in HELPERS.

The PDF file was created just fine. You need to give it a full path or it will end up either in \cxp20\bin (apache) or HELPERS (IIS). You can use the SendMail() function I gave you earlier to send the PDF to yourself by email.

Code: Select all

<%#Code locality="page-render"%>

<html>
<head>
<meta content="text/html; charset=iso-8859-2" http-equiv="content-type">
</head>

<body>

<%
cMessage := 'This is my message'
cResponse := MyESP_01(cMessage)
%>

<p>
test PScript

<br>
<br>

@(cResponse)

</p>

</body>
</html>




<%#Code locality="page-global"%>
<%

#include "tpscript.prg"
#include "PSCRIPT.CH"
#include "dcps.prg"
#INCLUDE "dcps.CH"
#INCLUDE "dcdialog.CH"

*****************
Function MyESP_01( _cMessage )    && MyExpressStylePrint
*****************

Local nDevice := 3           && direct print/output to pdf file
Local cFile   := 'c:\junk\test.pdf'
Local cMessage := _cMessage

FErase( cFile )

IF ! ( PSInit() == PSE_NOERROR )
   RETURN "PageScript 32 DLL not loaded/initialized/Unknown error"
ENDIF

PSSetDecimalSep(".")
PSSetDevice(nDevice)
PSSetFileName( cFile )

ExpressStylePrint( nDevice )

IF nDevice == DEV_PDFFILE
   If File( cFile )
     cMessage := "Document saved in file: " + cFile + '.'
   Else
     cMessage := "Document NOT saved in file: " + cFile + '!'
   EndIf
ENDIF

RETURN cMessage

* -----------

FUNCTION ExpressStylePrint(nDevice)

Local i := 0

DCPS BEGINDOC

FOR i := 1 TO 10
    @ i,1 DCPS SAY 'This is a line of Text - Line ' + Alltrim(Str(i))
NEXT

PSSetFileName( "" )   // I don't want AdobeReader's Preview

DCPS ENDDOC

RETURN nil

%>
The eXpress train is coming - and it has more cars.

Zdeno Bielik
Posts: 147
Joined: Thu Jan 28, 2010 9:24 am
Location: Nitra, Slovakia
Contact:

Re: Support for PageScript now in eXpress++

#9 Post by Zdeno Bielik »

Roger,

many thanks for working example, it looks super.
Unfortunately, I can't get it working with IIS.
I did try several combinations, but there is still any error,
when I want it show in WebBrowser.
I hope I will find soon, how and what to set-up for IIS.

I just started think about downloading and installing
free VirtualBox from http://www.virtualbox.org
and install e.g. Win7 or Win8
and then Apache server for tests...

Zdeno

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Support for PageScript now in eXpress++

#10 Post by rdonnay »

What is the error?
The eXpress train is coming - and it has more cars.

Post Reply