How to use OPRN and error pdf2.prg sample

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

How to use OPRN and error pdf2.prg sample

Postby tiagojbi » Thu Jun 25, 2020 5:53 pm

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/.
tiagojbi
 
Posts: 16
Joined: Mon Mar 09, 2020 4:27 pm

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

Postby Patricio Avalos Aguirre » Mon Jun 29, 2020 4:04 am

hello

Code: Select all  Expand view
// {% 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
User avatar
Patricio Avalos Aguirre
 
Posts: 1060
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

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

Postby tiagojbi » Mon Jun 29, 2020 12:08 pm

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
tiagojbi
 
Posts: 16
Joined: Mon Mar 09, 2020 4:27 pm

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

Postby Antonio Linares » Mon Jun 29, 2020 3:24 pm

Please use this mod_harbour version:

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby tiagojbi » Mon Jun 29, 2020 4:43 pm

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?
tiagojbi
 
Posts: 16
Joined: Mon Mar 09, 2020 4:27 pm

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

Postby Antonio Linares » Tue Jun 30, 2020 9:21 am

> 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby tiagojbi » Tue Jun 30, 2020 12:29 pm

>> 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!
tiagojbi
 
Posts: 16
Joined: Mon Mar 09, 2020 4:27 pm

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

Postby Antonio Linares » Tue Jun 30, 2020 2:54 pm

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_harbour/blob/master/windows/win32/mod_harbour.so
https://github.com/FiveTechSoft/mod_harbour/blob/master/windows/win32/libharbour.dll
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby tiagojbi » Tue Jun 30, 2020 5:08 pm

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
tiagojbi
 
Posts: 16
Joined: Mon Mar 09, 2020 4:27 pm

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

Postby Antonio Linares » Wed Jul 01, 2020 4:27 am

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
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby Otto » Wed Jul 01, 2020 10:42 am

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
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

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

Postby Antonio Linares » Wed Jul 01, 2020 10:56 am

Dear Otto,

yes
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby tiagojbi » Wed Jul 01, 2020 12:19 pm

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?
tiagojbi
 
Posts: 16
Joined: Mon Mar 09, 2020 4:27 pm

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

Postby Antonio Linares » Thu Jul 02, 2020 7:57 am

> 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
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby acuellar » Thu Jul 02, 2020 12:11 pm

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.
User avatar
acuellar
 
Posts: 1643
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Next

Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 3 guests