You are not logged in.
Hi,
great Work. Please can you manage to merge it into the synopse main branch?
best regards!
Still Win64 PurePascal problems, win32 is okay (todays trunk):
PDF\Synopse.inc(574)
PDF\Synopse.inc(574)
PDF\SynLZ.pas(1252)
PDF\SynopseCommit.inc(2)
PDF\SynCommons.pas(36842) Error: E2003 Undeclared identifier: 'CpuFeatures'
PDF\SynCommons.pas(36842) Error: E2015 Operator not applicable to this operand t
ype
PDF\SynCommons.pas(39857) Error: E2003 Undeclared identifier: 'RedirectCode'
PDF\SynCommons.pas(61259)
No problem to compile to Win64 on my side, with Delphi XE6 and 10.1.
Regression tests do pass.
With Win64 and switch PUREPASCAL too?
Same error with 64bit Delphi now.
SynCommon.pas is not compilable with switch PUREPASCAL on Delphi 7, because CPUINTEL is not set correctly at all. Trunk from today.
I forgot to mention: I am using the PurePascal switch. It was something with the CPUId stuff
s.a.
./.
Linux?
It is fixed. Thanks!
Should be fixed by http://synopse.info/fossil/info/0796c1e9a2
Thanks for the feedback.
Trunk compilation with define PurePascal and D6 fails.
D6 does not compile SynCommon.pas (purepascal mode). AtomicIncrement/Decrement is unknown.
I do this in similar form since years, but be careful: It does not work under FPC. FPCs IUnknown is working differently from Delphi' one. For details, please look at FPC bug tracker.
http://bugs.freepascal.org/view.php?id=26602
Be careful: Metafiles have a limitation of 96 dpi (the screen dpi) per default.
In Win32/64, but not in Linux etc.
Is it possible to create a PDF file with 2400 dpi and higher with SynPDF?
Thank you for pointing that out!
You mean pdf has 72 dpi and metafile 100dpmm=2540dpi?
The code below should produce a PDF file in A4 size with an ellipse inside touching the borders of A4 sheet.But it does not. A scale of 1.333 is needed instead of 1.0 to reach that.
procedure SaveAsPdf;
var
MetaFile: TMetafile;
MetaFileCanvas: TMetafileCanvas;
Pdf: TPdfDocument; //TPdfDocumentGDI ???
begin
Pdf := TPdfDocument.Create;
try
//psA4, psA5, psA3, psLetter, psLegal, psUserDefined
Pdf.DefaultPaperSize := psA4;
Log('DefaultPageWidth: %d', [Pdf.DefaultPageWidth]);
Log('DefaultPageHeight: %d', [Pdf.DefaultPageHeight]);
// 595 = 210 mm * 72 dpi
// 842 = 297 mm * 72 dpi
Metafile := TMetafile.Create;
MetaFileCanvas := TMetaFileCanvas.Create(Metafile, 0);
try
MetaFileCanvas.Ellipse(Rect(0, 0, 594, 841));
finally
MetaFileCanvas.Free;
end;
Pdf.NewDoc;
Pdf.AddPage;
Pdf.Canvas.RenderMetaFile(Metafile, 1.3333333, 0, 0);
Pdf.SaveToFile('c:\test1.pdf');
finally
Pdf.Free;
end;
end;
I noticed that. :-) But it won't compile without it.
RedirtectCode is being called in SynRegisterCustomVariantType when DoPatchRTL is off.
InitCrc32Tab not found, when undefing use_synzip. Does it belong to SynPDF at all?
Thanks!
You should apply bugfix1 first. Second question: What is PurePascal for when its not a solution?
I had several crashes of program and debugger in D6. Undefing DOPATCHTRTL and using PurePascal solve 2 of them. See post above. I prefer not having manipulations on my RTL/VCL. This is the cause for most problems I had so far.
bugfix3:
Following procedures don't respect the PurePascal define:
function SystemFillCharAddress: Pointer;
procedure CopyArray(dest, source, typeInfo: Pointer; cnt: PtrUInt);
procedure _Finalize(Data: Pointer; TypeInfo: Pointer);
procedure RecordCopy(var Dest; const Source; TypeInfo: pointer);
procedure RecordClear(var Dest; TypeInfo: pointer);
function VariantsDispInvokeAddress: pointer;
procedure _DynArrayClear(var a: Pointer; typeInfo: Pointer);
procedure _FinalizeArray(p: Pointer; typeInfo: Pointer; elemCount: PtrUInt);
procedure SynRtlUnwind(TargetFrame, TargetIp: pointer; ExceptionRecord: PExceptionRecord; ReturnValue: Pointer); stdcall;
function TSynLog._Release: Integer;
class function TSynLog.Enter(aInstance: TObject; aMethodName: PUTF8Char; aMethodNameLocal: boolean): ISynLog;
procedure TSynLog.Log(Level: TSynLogInfo);
procedure AddStackManual(Stack: PPtrUInt);
64bit:
function StrInt32(P: PAnsiChar; val: PtrInt): PAnsiChar;
function StrUInt32(P: PAnsiChar; val: PtrUInt): PAnsiChar;
function bswap32(a: cardinal): cardinal; {$ifdef FPC}nostackframe; assembler;{$endif}
function StrLen(S: pointer): PtrInt;
bugfix1:
{$ifdef DOPATCHTRTL}
if DebugHook=0 then // patch VCL/RTL only outside debugging
InitRedirectCode;
{$endif}
bugfix2:
{$define PUREPASCAL}
This unit does not work with D6 very well.
I get not reproducible Debugger crash (Delphi 6) here:
InitSynCommonConversionTables;
or
RetrieveSystemInfo;
This unit does not work with D6 very well.
I get not reproducible Debugger crash (Delphi 6) here:
InitSynCommonConversionTables;
or
RetrieveSystemInfo;
Please would you split up SynCommon.pas into at least 10 units? 1.5MB is very hard to handle. Half an hour for scrolling bothers...
Thank you!
I still saw the error several times in the Nightly Build zip from today.
Please see: http://bugs.freepascal.org/view.php?id=26570 which references to SynCommon.
.
Compiling PDF\SynCommons.pas
SynCommons.pas(8475,14) Error: There is no method in an ancestor class to be ove
rridden: "FixupIdent(const AnsiString):AnsiString;"
SynCommons.pas(10995,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: d:\lazarus\fpc\2.7.1\bin\i386-win32\ppc386.exe returned an error exitcode
One more Delphi 6 compilation issue:
function TJSONCustomParserCustomRecord.CustomReader(P: PUTF8Char;
var aValue; out EndOfObject: AnsiChar): PUTF8Char;
var valid: boolean;
begin
result := GetJSONCustomParserRegistration.Reader(P,aValue,valid); //<---------------------------D6: Internal error: C3890
if not valid then
result := nil;
if result=nil then
exit;
EndOfObject := result^;
if result^ in [',','}',']'] then
inc(result);
end;
[Fatal Error] SynCommons.pas(25431): Internal error: C3890
1252
TsysAnsiConvert.Engine causes an floating point error in TSynAnsiFixedWidth.Create(1252) -> Move procedure.
Still having problem with SysCommon and D6. Runtime errors. ? Don't know whats wrong.
PDF Engine does not work under D6. SysCommon causes a run time error during initialisation. Moreover ifdef Variants make problems.
All compilation hints are gone now in D6..XE3. Thanks.
Some XE3 compiler issues:
PDF\SynPdf.pas(2686) Hint: H2443 Inline function 'Point' has not been expanded because unit 'System.Types' is not specified in USES list
PDF\SynPdf.pas(3058) Hint: H2443 Inline function 'TList.Remove' has not been expanded because unit 'System.Types' is not specified in USES list
PDF\SynPdf.pas(3267) Hint: H2443 Inline function 'TList.Remove' has not been expanded because unit 'System.Types' is not specified in USES list
PDF\SynPdf.pas(6162) Warning: W1057 Implicit string cast from 'AnsiString' to 'string'
PDF\SynPdf.pas(6239) Warning: W1000 Symbol 'ByteType' is deprecated: 'Moved to the AnsiStrings unit'
PDF\SynPdf.pas(6245) Warning: W1000 Symbol 'ByteType' is deprecated: 'Moved to the AnsiStrings unit'
PDF\SynPdf.pas(7485) Warning: W1057 Implicit string cast from 'AnsiString' to 'string'
PDF\SynPdf.pas(7567) Warning: W1057 Implicit string cast from 'AnsiString' to 'string'
PDF\SynPdf.pas(8164) Hint: H2443 Inline function 'Point' has not been expanded because unit 'System.Types' is not specified in USES list
PDF\SynPdf.pas(8403) Hint: H2443 Inline function 'Point' has not been expanded because unit 'System.Types' is not specified in USES list
PDF\SynPdf.pas(8420) Hint: H2443 Inline function 'Point' has not been expanded because unit 'System.Types' is not specified in USES list
I have the same problems with Metafiles rendering.
Thank you for the information.
with Delphi XE2 64 bit and FPC 32 bit. Some kind of ifdef mismatch I guess.
D2009:
CodeGear Delphi for Win32 compiler version 20.0
Copyright (c) 1983,2008 CodeGear
PDF\SynLZ.pas(1151)
PDF\SynCommons.pas(24283) Error: E2250 There is no overloaded version of 'Map'
hat can be called with these arguments
PDF\SynCommons.pas(24553) Error: E2003 Undeclared identifier: 'fFileLocal'
PDF\SynCommons.pas(24589) Error: E2003 Undeclared identifier: 'fFileLocal'
PDF\SynCommons.pas(24592) Error: E2037 Declaration of 'Map' differs from previ
s declaration
PDF\SynCommons.pas(24599) Error: E2003 Undeclared identifier: 'Map'
PDF\SynCommons.pas(24602) Error: E2003 Undeclared identifier: 'fFileLocal'
PDF\SynCommons.pas(24611) Error: E2003 Undeclared identifier: 'fFileLocal'
PDF\SynCommons.pas(29855) Error: E2250 There is no overloaded version of 'Map'
hat can be called with these arguments
PDF\SynCommons.pas(30612)
XE2 64 bit:
Embarcadero Delphi for Win64 compiler version 23.0
Copyright (c) 1983,2011 Embarcadero Technologies, Inc.
PDF\SynLZ.pas(1151)
PDF\SynCommons.pas(29094) Error: E2003 Undeclared identifier: 'SynLogFile'
PDF\SynCommons.pas(29094) Error: E2015 Operator not applicable to this operand
ype
PDF\SynCommons.pas(29099) Error: E2066 Missing operator or semicolon
PDF\SynCommons.pas(29101) Error: E2003 Undeclared identifier: 'SynLogFileIndex'
PDF\SynCommons.pas(29116) Error: E2003 Undeclared identifier: 'SynLogFile'
PDF\SynCommons.pas(29116) Error: E2015 Operator not applicable to this operand
ype
PDF\SynCommons.pas(29119) Error: E2029 'DO' expected but identifier 'Count' fou
d
PDF\SynCommons.pas(29120) Error: E2029 ')' expected but identifier 'List' found
PDF\SynCommons.pas(29208) Error: E2003 Undeclared identifier: 'SynLogFileIndex'
PDF\SynCommons.pas(29210) Error: E2003 Undeclared identifier: 'SynLogFile'
PDF\SynCommons.pas(29210) Error: E2066 Missing operator or semicolon
All other compiler compile smooth.
Please try this
replace
{.$define PUREPASCAL}
with
{$define PUREPASCAL}
in synopse.inc
Any news on the PDF Engine for 64 bit?
You have to find the op-codes of the asm commands. Then replace the asm by the op-codes.
Yep. I think the main problem are the two zlib obj files which are needed in 64 bit style too.
But without 64 bit compilation!?
And in order to embed the SQLite3 engine as a static library, it will need some work about the C RTL.
There is a System.Win.Crtl.pas now that provides MS C RTL functions!