How to use OPRN and error pdf2.prg sample

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!
tiagojbi
Posts: 16
Joined: Mon Mar 09, 2020 4:27 pm

How to use OPRN and error pdf2.prg sample

Post by tiagojbi »

Hello, I'm trying to run pdf2.prg from your test server: https://www.modharbour.org/modharbour_samples/pdf2.prg.
However I am getting the error:

Error: Can't open #include file 'hbclass.ch'
called from: __PP_PROCESS, line: 0
called from: ../apache.prg, EXECUTE, line: 130

Source:
0128: ENDCLASS
0129:
0130 =>//------------------------------------------------------------------------------
0131:
0132: METHOD New( cFileName, cPassword, cOwnerPassword, nPermission, lPreview ) CLASS TPdf

could they help me? I would like to use this example in my hosting at https://xbhosts.com/.
User avatar
Patricio Avalos Aguirre
Posts: 1028
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile
Contact:

Re: How to use OPRN and error pdf2.prg sample

Post by Patricio Avalos Aguirre »

hello

Code: Select all

// {% hb_SetEnv( "HB_INCLUDE", "C:\hb30web\include" ) %}

STATIC aTtfFontList:= NIL
STATIC cFontDir

//--- problemas con cos,sin

function Main()

   local def_font, tw, i := 0
   local cPageTitle := "Title of the page"
   local font_list := { "Courier", "Courier-Bold", "Courier-Oblique", "Courier-BoldOblique",;
                        "Helvetica", "Helvetica-Bold", "Helvetica-Oblique", "Times-Roman",;
                        "Times-Bold", "Times-Italic", "Times-BoldItalic", "Symbol", "ZapfDingbats" }
   local oPrn

   oPrn := TPdf():New( "list" )
   oPrn:LoadedFonts := font_list
   if Empty( oPrn:hPdf )
      ? "PDFs not available!"
      return NIL
   endif

    oFont1 := oPrn:DefineFont( 'Helvetica',  24 )
   oFont3 := oPrn:DefineFont( 'Helvetica', 16 )
   oFont2 := oPrn:DefineFont( 'Helvetica-Bold', 16 )

   oPrn:StartPage()

   height :=  oprn:nVertSize()
   width  :=  oprn:nHorzSize()
   oPrn:Rect( 10, 10, height-20, width-20 ,  1 )
   oPrn:cmSay(  2, 7, cPageTitle, oFont1 )

   x = 90

   for n = 1 to Len( font_list )
      samp_text = "abcdefgABCDEFG12345!#$%&+-@?"
      oFont2    = oPrn:DefineFont( font_list[ n ], 16 )
      oPrn:Say( x + n * 40,  30, font_list[ n ], oFont2 )
      oPrn:Say( x + n * 40, 220, samp_text, oFont2 )
   next

   oPrn:EndPage()
   oPrn:Save( hb_GetEnv( "PRGPATH" ) + "/test2.pdf" )
   oPrn:end()

   ?? "<iframe src='test2.pdf' style='width:calc( 100% + 16px );height:100%;border:0px;margin:-8px;'></iframe>"

return nil
Image
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
tiagojbi
Posts: 16
Joined: Mon Mar 09, 2020 4:27 pm

Re: How to use OPRN and error pdf2.prg sample

Post by tiagojbi »

After use your code:

Error: Unknown or unregistered symbol
operation: TPDF
called from: ../../apache.prg, (b)MAIN, line: 50
called from: HB_HRBLOAD, line: 0
called from: ../../apache.prg, EXECUTE, line: 116
called from: ../../apache.prg, MAIN, line: 61
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: How to use OPRN and error pdf2.prg sample

Post by Antonio Linares »

Please use this mod_harbour version:

https://github.com/FiveTechSoft/mod_harbour/releases
regards, saludos

Antonio Linares
www.fivetechsoft.com
tiagojbi
Posts: 16
Joined: Mon Mar 09, 2020 4:27 pm

Re: How to use OPRN and error pdf2.prg sample

Post by tiagojbi »

Please, how to mod_harbour update on xbHosts.com sever?

and how to find release of mod_harbour in 32bits for my local workspace server?
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: How to use OPRN and error pdf2.prg sample

Post by Antonio Linares »

> Please, how to mod_harbour update on xbHosts.com sever?

cd mod_harbour
git pull

> and how to find release of mod_harbour in 32bits for my local workspace server?

Is it for Windows 32 ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
tiagojbi
Posts: 16
Joined: Mon Mar 09, 2020 4:27 pm

Re: How to use OPRN and error pdf2.prg sample

Post by tiagojbi »

>> after execute:
cd mod_harbour
git pull

some error in access sample: http://54.37.60.42/modharbour_samples/pdf2.prg:

Error: Can't open #include file 'hbclass.ch'
called from: __PP_PROCESS, line: 0
called from: ../source/exec.prg, EXECUTE, line: 64

Source:
0062: DATA LoadedFonts
0063: DATA aPages
0064 => DATA nCurrentPage
0065:
0066: DATA nPageSize INIT HPDF_PAGE_SIZE_A4

and after access http://54.37.60.42/jbiloja/index.prg

Error: Unknown or unregistered symbol
operation: AP_HEADERSIN
called from: HB_HRBLOAD, line: 0
called from: ../source/exec.prg, EXECUTE, line: 70

Source:
0068: endif
0069:
0070 =>
0071:
0072:

>> about mod_harbour32.zip with 3.2.0 where's find this file?

Thank you very much for your attention so far!
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: How to use OPRN and error pdf2.prg sample

Post by Antonio Linares »

Please create a /url/include/harbour folder and place all Harbour CH files there:

sudo mkdir /url/include/harbour
sudo cp -R /home/user/harbour/include /url/include/harbour

mod_harbour Win32 version:
https://github.com/FiveTechSoft/mod_har ... harbour.so
https://github.com/FiveTechSoft/mod_har ... arbour.dll
regards, saludos

Antonio Linares
www.fivetechsoft.com
tiagojbi
Posts: 16
Joined: Mon Mar 09, 2020 4:27 pm

Re: How to use OPRN and error pdf2.prg sample

Post by tiagojbi »

I performed the procedures above and when accessing: "http://54.37.60.42/modharbour_samples/pdf2.prg"
He returned:

Error: Can't open #include file 'hbclass.ch'
called from: __PP_PROCESS, line: 0
called from: ../source/exec.prg, EXECUTE, line: 64

Source:
0062: DATA LoadedFonts
0063: DATA aPages
0064 => DATA nCurrentPage
0065:
0066: DATA nPageSize INIT HPDF_PAGE_SIZE_A4
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: How to use OPRN and error pdf2.prg sample

Post by Antonio Linares »

Please modify the header file used in pdf2.prg to use:

#include "/usr/include/harbour/hbclass.ch"
#include "/usr/include/harbour/hboo.ch"
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: How to use OPRN and error pdf2.prg sample

Post by Otto »

Dear Antonio,
Many thanks.
Do you automatically update the examples on GitHub?

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: How to use OPRN and error pdf2.prg sample

Post by Antonio Linares »

Dear Otto,

yes
regards, saludos

Antonio Linares
www.fivetechsoft.com
tiagojbi
Posts: 16
Joined: Mon Mar 09, 2020 4:27 pm

Re: How to use OPRN and error pdf2.prg sample

Post by tiagojbi »

I put the suggested information in the header of the file but it generated the error:
------------
Error: Can't open #include file '/usr/include/harbour/hbclass.ch'
called from: __PP_PROCESS, line: 0
called from: ../source/exec.prg, EXECUTE, line: 64

Source:
------------

Would it be possible to "format" the server and create it again with the updated mod_harbour?
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: How to use OPRN and error pdf2.prg sample

Post by Antonio Linares »

> Would it be possible to "format" the server and create it again with the updated mod_harbour?

Yes, sure, we are going to do it
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
acuellar
Posts: 1312
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: How to use OPRN and error pdf2.prg sample

Post by acuellar »

Estimado Antonio

Hice el cambio sugerido y ahora sale:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Gracias por la ayuda
Saludos,

Adhemar C.
Post Reply