FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index mod_harbour How to use OPRN and error pdf2.prg sample
Posts: 16
Joined: Mon Mar 09, 2020 04:27 PM
How to use OPRN and error pdf2.prg sample
Posted: Thu Jun 25, 2020 05: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/.

Posts: 1074
Joined: Fri Oct 07, 2005 01:56 PM
Re: How to use OPRN and error pdf2.prg sample
Posted: Mon Jun 29, 2020 04:04 AM
hello

Code (fw): Select all Collapse
// {% 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

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
Posts: 16
Joined: Mon Mar 09, 2020 04:27 PM
Re: How to use OPRN and error pdf2.prg sample
Posted: 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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to use OPRN and error pdf2.prg sample
Posted: Mon Jun 29, 2020 03:24 PM
Please use this mod_harbour version:

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

Antonio Linares
www.fivetechsoft.com
Posts: 16
Joined: Mon Mar 09, 2020 04:27 PM
Re: How to use OPRN and error pdf2.prg sample
Posted: Mon Jun 29, 2020 04: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?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to use OPRN and error pdf2.prg sample
Posted: Tue Jun 30, 2020 09: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
Posts: 16
Joined: Mon Mar 09, 2020 04:27 PM
Re: How to use OPRN and error pdf2.prg sample
Posted: 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!

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to use OPRN and error pdf2.prg sample
Posted: Tue Jun 30, 2020 02: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
Posts: 16
Joined: Mon Mar 09, 2020 04:27 PM
Re: How to use OPRN and error pdf2.prg sample
Posted: Tue Jun 30, 2020 05: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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to use OPRN and error pdf2.prg sample
Posted: Wed Jul 01, 2020 04: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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: How to use OPRN and error pdf2.prg sample
Posted: Wed Jul 01, 2020 10:42 AM

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

Best regards,
Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to use OPRN and error pdf2.prg sample
Posted: Wed Jul 01, 2020 10:56 AM

Dear Otto,

yes

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 16
Joined: Mon Mar 09, 2020 04:27 PM
Re: How to use OPRN and error pdf2.prg sample
Posted: 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?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to use OPRN and error pdf2.prg sample
Posted: Thu Jul 02, 2020 07: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
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: How to use OPRN and error pdf2.prg sample
Posted: 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.