[MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

Julio Jiménez
Hi Martin.

I tried to write a little example using fcl-pdf and it fails to compile using MSE*

If I compile the same example using fpc (without MSE includes, paths...) all is fine.

The error:
Free Pascal Compiler version 3.0.5 [2017/12/28] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling testpdf.pas
PPU Loading /home/jujibo/FreePascal-3.0.5/fpc/lib/fpc/3.0.5/units/x86_64-linux/fcl-pdf/fppdf.ppu
PPU Source: fppdf.pp not available
PPU Source: fontmetrics_stdpdf.inc not available
Recompiling fpPDF, checksum changed for fpimage
testpdf.pas(7,3) Fatal: Can't find unit fpPDF used by testpdf
Fatal: Compilation aborted

The smallest example (just adding the required unit):

program testpdf;
{$ifdef FPC}{$mode objfpc}{$h+}{$endif}
{$ifdef mswindows}{$apptype console}{$endif}
uses
 {$ifdef FPC}{$ifdef unix}cthreads,cwstring,{$endif}{$endif}
 sysutils,
 fppdf;
begin
 writeln('hello world');
end.

Thanks.

--
Julio Jiménez Borreguero

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

mse
Administrator
On Monday 15 January 2018 18:12:00 Julio Jiménez wrote:
> Hi Martin.
>
> I tried to write a little example using fcl-pdf and it fails to compile
> using MSE*
>
> If I compile the same example using fpc (without MSE includes, paths...)
> all is fine.
>
Please check the compiler commandline with 'Project'-'Options'-'Show
commandline' if is the same as you use for fpc.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

Julio Jiménez


2018-01-15 19:39 GMT+01:00 Martin Schreiber <[hidden email]>:

Please check the compiler commandline with 'Project'-'Options'-'Show
commandline' if is the same as you use for fpc.

I did before asking. It fails compiling when you include the MSE* paths. BTW have you tried adding the unit fppdf to any MSE project? I can use other fpc packages and no problem.

Output:

Compiling with MSE 

$ ppcx64 -otestpdf -Fu/home/jujibo/FreePascal-3.0.5/mseide/mseide-msegui/lib/common/* -Fu/home/jujibo/FreePascal-3.0.5/mseide/mseide-msegui/lib/common/kernel/linux -Fu/home/jujibo/FreePascal-3.0.5/mseide/mseide-msegui/lib/addon/* -Fi/home/jujibo/FreePascal-3.0.5/mseide/mseide-msegui/lib/addon/* -Xg -l -Mobjfpc -Sh -Fcutf8 -gl -O- testpdf.pas
Free Pascal Compiler version 3.0.5 [2017/12/07] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling testpdf.pas
PPU Loading /home/jujibo/FreePascal-3.0.5/fpc/lib/fpc/3.0.5/units/x86_64-linux/fcl-pdf/fppdf.ppu
PPU Source: fppdf.pp not available
PPU Source: fontmetrics_stdpdf.inc not available
Recompiling fpPDF, checksum changed for fpimage
testpdf.pas(6,12) Fatal: Can't find unit fpPDF used by testpdf
Fatal: Compilation aborted

Compiling removing MSE paths:

$ ppcx64 -otestpdf -Xg -l -Mobjfpc -Sh -Fcutf8 -gl -O- testpdf.pas
Free Pascal Compiler version 3.0.5 [2017/12/07] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling testpdf.pas
Linking testpdf
/usr/bin/ld: aviso: link.res contiene secciones de salida. ¿Olvidó -T?
9 lines compiled, 2.0 sec


--
Julio Jiménez Borreguero

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

Graeme Geldenhuys
On 2018-01-15 20:38, Julio Jiménez wrote:
> I did before asking. It fails compiling when you include the MSE* paths.
> BTW have you tried adding the unit fppdf to any MSE project? I can use
> other fpc packages and no problem.

Strange, considering that I implemented most of fcl-pdf using MSEide. :)
Granted, I didn't build MSE* applications, but I can't see why they
wouldn't work together. fcl-pdf is just another library of Object Pascal
units.

 From the compiler errors you listed, it simply looks like missing or
incorrect Unit Paths and Include Paths. Seeing as their is also a
"checksum changed for fpimage" message in there, maybe you have some FPC
version conflict in your fpc.cfg file.

Regards,
   Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

mse
Administrator
In reply to this post by Julio Jiménez


On 01/15/2018 09:38 PM, Julio Jiménez wrote:

>
>
> 2018-01-15 19:39 GMT+01:00 Martin Schreiber <[hidden email]
> <mailto:[hidden email]>>:
>
>
>     Please check the compiler commandline with 'Project'-'Options'-'Show
>     commandline' if is the same as you use for fpc.
>
>
> I did before asking. It fails compiling when you include the MSE* paths.
> BTW have you tried adding the unit fppdf to any MSE project? I can use
> other fpc packages and no problem.
>
If you want it to combine it with MSEgui units "mclasses" must be added
after "classes" in uses clauses of fpPDF, see for example how it is done
in Zeoslib:
"
unit ZAbstractDataset;

interface

{$I ZComponent.inc}

uses
  Variants,
  SysUtils,  Classes, {$IFDEF MSEgui}mdb, mclasses{$ELSE}DB{$ENDIF},
  ZSqlUpdate, ZDbcIntfs, ZVariant, ZDbcCache, ZDbcCachedResultSet,
  ZAbstractRODataset, ZCompatibility, ZSequence;
"
There maybe will be more problems with forked units in
"lib/common/fpccompatibility".

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

Julio Jiménez


2018-01-16 6:47 GMT+01:00 Martin Schreiber <[hidden email]>:



If you want it to combine it with MSEgui units "mclasses" must be added
after "classes" in uses clauses of fpPDF, see for example how it is done
in Zeoslib:
"
unit ZAbstractDataset;

interface

{$I ZComponent.inc}

uses
  Variants,
  SysUtils,  Classes, {$IFDEF MSEgui}mdb, mclasses{$ELSE}DB{$ENDIF},
  ZSqlUpdate, ZDbcIntfs, ZVariant, ZDbcCache, ZDbcCachedResultSet,
  ZAbstractRODataset, ZCompatibility, ZSequence;
"
There maybe will be more problems with forked units in
"lib/common/fpccompatibility".

I also tried it but no luck. I see there is fpimage in "lib/common/fpccompatibility" and fppdf uses it may be you need a fppdf in fpccompatibility...

In fact, fppdf uses:

uses
  Classes,
  SysUtils,
  StrUtils,
  contnrs,
  fpImage,
  FPReadJPEG, FPReadPNG, FPReadBMP, // these are required for auto image-handler functionality
  zstream,
  fpparsettf,
  fpTTFSubsetter,
  FPFontTextMapping;

Thanks.

--
Julio Jiménez Borreguero

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

Julio Jiménez
In reply to this post by Graeme Geldenhuys


2018-01-16 0:58 GMT+01:00 Graeme Geldenhuys <[hidden email]>:

Strange, considering that I implemented most of fcl-pdf using MSEide. :) Granted, I didn't build MSE* applications, but I can't see why they wouldn't work together. fcl-pdf is just another library of Object Pascal units.


Well, I'm not talking about using MSEide ;) 

 
From the compiler errors you listed, it simply looks like missing or incorrect Unit Paths and Include Paths. Seeing as their is also a "checksum changed for fpimage" message in there, maybe you have some FPC version conflict in your fpc.cfg file.


No, there aren't paths or config problems. The problem is because MSEgui units. Martin has forked lots of fpc units in "lib/common/fpccompatibility". There is a fpimage unit in fpccompatibility path that's why the checksum error.

I know you have implemented most of fcl-pdf. I was following your work. It took more time than desired but it's really good. I'm also waiting for fcl-report to be added to stable/fixes branch,  I know it can be used in fpc 3.0.4/5 too but I fear breaking changed to be used in production. For now, I'll continue using lazreport for desktop (mse and lazarus) and my own pdf implementation for web.

Regards

--
Julio Jiménez Borreguero

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

mse
Administrator
In reply to this post by Julio Jiménez
On Tuesday 16 January 2018 09:55:36 Julio Jiménez wrote:
> >
> > I also tried it but no luck. I see there is fpimage in
>
> "lib/common/fpccompatibility" and fppdf uses it may be you need a fppdf in
> fpccompatibility...
>
What happens if you recompile the fpPDF units with lib/common/fpccompatibility
in unit path?

> In fact, fppdf uses:
>
> uses
>   Classes,
>   SysUtils,
>   StrUtils,
>   contnrs,
>   fpImage,
>   FPReadJPEG, FPReadPNG, FPReadBMP, // these are required for auto
> image-handler functionality

Try to add dummy units for FPReadJPEG, FPReadPNG, FPReadBMP which list the
according MSEgui units in uses (mseformatjpgread, mseformatpngread,
mseformatbmpicoread).

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

Julio Jiménez


2018-01-16 17:26 GMT+01:00 Martin Schreiber <[hidden email]>:
On Tuesday 16 January 2018 09:55:36 Julio Jiménez wrote:
> >
> > I also tried it but no luck. I see there is fpimage in
>
> "lib/common/fpccompatibility" and fppdf uses it may be you need a fppdf in
> fpccompatibility...
>
What happens if you recompile the fpPDF units with lib/common/fpccompatibility
in unit path?


I get lots of errors about Goy MCLASSES.tstream, expected CLASSES.TStream

Probably it needs lots of changes for a simple test and I haven't too much time right now :( I was waiting to use a standard fpc package without problems in MSEgui but it seems is not so simple.

Thanks


Julio Jiménez Borreguero

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

mse
Administrator
On Tuesday 16 January 2018 17:50:13 Julio Jiménez wrote:

> 2018-01-16 17:26 GMT+01:00 Martin Schreiber <[hidden email]>:
> > On Tuesday 16 January 2018 09:55:36 Julio Jiménez wrote:
> > > > I also tried it but no luck. I see there is fpimage in
> > >
> > > "lib/common/fpccompatibility" and fppdf uses it may be you need a fppdf
> >
> > in
> >
> > > fpccompatibility...
> >
> > What happens if you recompile the fpPDF units with
> > lib/common/fpccompatibility
> > in unit path?
>
> I get lots of errors about Goy MCLASSES.tstream, expected CLASSES.TStream
>
The uses clauses in fpPDF must be extended, please see the Zeos example I
posted.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

Julio Jiménez


2018-01-16 17:55 GMT+01:00 Martin Schreiber <[hidden email]>:

The uses clauses in fpPDF must be extended, please see the Zeos example I
posted.

Is what I did. Fails creating streams... unit zstream (it uses the fpcompatibility one)

--
Julio Jiménez Borreguero

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

Julio Jiménez

At the end I got it working (compiling) but had to modify two units: fppdf and fpttfsubsetter, this last used by fppdf

I haven't generated any pdf yet, only compiling.. but it's a first step, the worse is the need to modify a standard fpc package.

Regards

--
Julio Jiménez Borreguero

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

Julio Jiménez
In reply to this post by mse


Git it working... all except images.. I'll take a look later.

Generated PDF is ok, even subset TTF font embedding.

Thanks.

--
Julio Jiménez Borreguero

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Freepascal package fcl-pdf not working with MSE

Graeme Geldenhuys
On 2018-01-16 17:46, Julio Jiménez wrote:
> Generated PDF is ok, even subset TTF font embedding.

On a side note:
   The TTF font subset embedding took forever to implement. I read the
PDF specs over and over and still couldn't figure it out. I then reverse
engineered existing PDF's generated by LibreOffice and other software,
and eventually managed to get it working in fpPDF. :)

Regards,
   Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk