#1 2023-11-22 07:12:34

loadymf
Member
Registered: 2023-10-20
Posts: 4

Compile SynPdf error

when I complie synpdf,on lazarus 2.2.2 fpc3.2.2(target win32,i386 )
SynPdf.pas  Error: Identifier not found "TMetaFile"
procedure RenderMetaFile(MF: TMetaFile; ScaleX: Single=1.0; ScaleY: Single=0.0;
      XOff: single=0.0; YOff: single=0.0;
      TextPositioning: TPdfCanvasRenderMetaFileTextPositioning=tpSetTextJustification;
      KerningHScaleBottom: single=99.0; KerningHScaleTop: single=101.0;
      TextClipping: TPdfCanvasRenderMetaFileTextClipping=tcAlwaysClip);
add uses synfpcmetafile,it disp many error:
SynPdf.pas(3010,8) Error: Wrong number of parameters specified for call to "GetFontData"
font.inc(135,10) Error: Found declaration: GetFontData(LongWord):<record type>;
SynPdf.pas(3014,6) Error: Wrong number of parameters specified for call to "GetFontData"
font.inc(135,10) Error: Found declaration: GetFontData(LongWord):<record type>;
SynPdf.pas(3029,57) Error: Incompatible type for arg no. 7: Got "LongWord", expected "PDWord"
SynPdf.pas(3135,38) Error: Call by var for arg no. 3 has to match exactly: Got "PChar" expected "Byte"
SynPdf.pas(3149,38) Error: Call by var for arg no. 3 has to match exactly: Got "PChar" expected "Byte"


Lazarus 2.24 FPC3.2.2

Offline

#2 2023-11-22 13:37:02

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: Compile SynPdf error

SynPDF is NOT compatible with Lazarus.

Offline

#3 2023-11-22 13:58:38

rvk
Member
Registered: 2022-04-14
Posts: 93

Re: Compile SynPdf error

@loadymf. In addition... you might want to try mORMot 2 which includes src/ui/mormot.ui.pdf.pas with the latest changes to the PDF engine. It might give you more luck.

Offline

#4 2023-11-22 17:47:56

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: Compile SynPdf error

At least the mORMot 2 unit (should) compile with FPC and Windows.
But it has not been tested nor validated yet.

Any help is welcome!

Offline

#5 2023-11-22 19:34:04

rvk
Member
Registered: 2022-04-14
Posts: 93

Re: Compile SynPdf error

ab wrote:

At least the mORMot 2 unit (should) compile with FPC and Windows.

You probably just want the complete mORMot 2 package. Compiling just the mormot.ui.pdf.pas will pull in everything else anyway.

Compiling mORMot 2 on Lazarus/FPC trunk (from 2 months ago) works fine.

I only had to include mormot.ui.pdf.pas and mormot.lib.uniscribe as files in my console project because they are not in the mormot2ui.lpk.
(mormot.ui.report.pas is missing there too)

I did get this message during install of mormot2ui.lpk.

Suspicious include path
The package mormot2ui 2.0.1 adds the path "$(PkgIncPath)" to the include path of the IDE.
This is probably a misconfiguration of the package.

It probably doesn't add the path to the include path.
The path is in the package but somehow it doesn't get included automatically to the project when adding mormot2ui as requirement.

Manually setting "mORMot2\src\ui;mORMot2\src\lib" as "Other unit files" in projects options works too.

After that, creating a PDF with TPdfDocumentGDI isn't a problem.

Can't speak about the rest of mORMot 2 wink

But overall, using mormot.ui.pdf shouldn't be too hard on Lazarus (Windows, I didn't test Linux).

BTW. mormot2ui should install designtime components, shouldn't it?
I don't think it does. It does have the "Install" button but I don't think it really installs anything.
(or I'm just looking in the wrong place)

Edit: Ah, this probably answers it wink

// do-nothing-unit on non Delphi + Windows system
// = not yet compatible with FPC/LCL due to a lot of Windowsims and VCLisms :(
procedure Register;
begin
end;

Last edited by rvk (2023-11-22 19:42:38)

Offline

#6 2023-11-22 20:32:55

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: Compile SynPdf error

You are right, mormot2ui does not install any component - there is no component installed with Lazarus packages anway IIRC.

Note that mormot.ui.pdf would work on Windows only, as documented in the unit.

Offline

#7 2023-11-22 20:55:46

rvk
Member
Registered: 2022-04-14
Posts: 93

Re: Compile SynPdf error

ab wrote:

You are right, mormot2ui does not install any component - there is no component installed with Lazarus packages anway IIRC.

No, components are installed via packages in Lazarus. Same as with Delphi. Only when you click Install the whole IDE (lazarus) gets re-compiled.

Now the mormot2ui package is made as an install (design-time) package which recompiles the IDE while this shouldn't be necessary because there is no components installed. So it can just be a non-design package (same as the mormot2).

It does work as it is now but "Install" wouldn't be needed I think.
Unless components are added.

BTW. In Delphi only the path is added to the project after which everything gets compiled automatically. This could also be done the same way with Lazarus or FPC. But a package could add that path automatically which is easier. But I think the package could also just contain all the needed paths without adding all the files specifically (but somehow that doesn't work correctly now). I will look into that.

ab wrote:

Note that mormot.ui.pdf would work on Windows only, as documented in the unit.

Ah, yeah, I didn't look at that. I think FPC has its own fcl-pdf package anyway.

Offline

#8 2023-11-23 10:44:42

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: Compile SynPdf error

rvk wrote:

Ah, yeah, I didn't look at that. I think FPC has its own fcl-pdf package anyway.

Yes, fpc-pdf is cross-platform, but has not the same featureset - especially no support of regular TCanvas drawing or windows metafiles (nor encryption or other advanced features). My guess it is also slower.

Offline

Board footer

Powered by FluxBB