#1 Re: Other components » SynCommon except on initialize application » 2017-12-29 03:18:37

I can report this issue is also present with Delphi 2007, running Win10 x64 (and build 1.18.2194, not current).  Same conditions, i.e. MadExcept enabled, crash on buffer overrun enabled.

Dekhi 2007 Stack trace

Actually @Ab, I'm not sure I agree that the reading outside of a buffer is necessarily safe - the actual read is safe - i.e. it can't clobber memory like a write will - but the user might still like to know that they have read outside of a buffer, especially if they are planning on using the data they have read.

Maybe a conditional that would compile a (slower) version of SynCommons.StrCompSSE42 that was compatible with MadExcept?

#2 Re: PDF Engine » PDF renders fine in Acrobat but when printed fonts are huge [SOLVED] » 2016-01-17 21:38:06

<redface>  False alarm.  The printer had lost its marbles and a restart of the printer fixed the problem. </redface>

Sorry to waste your time.  You may wish to delete the thread, or it might be useful if it happens to anyone else.

Thanks,
R

#3 PDF Engine » PDF renders fine in Acrobat but when printed fonts are huge [SOLVED] » 2016-01-17 21:04:14

rossmcm
Replies: 3

I'm playing with SynPDF and generating a sample report with the code at http://synopse.info/forum/viewtopic.php?id=41.  The produced PDF previews fine, and if I save it to a PDF file using the ExportPDF method, the resulting PDF looks the same in Acrobat as it does in the Preview window.

When I print the PDF however, (on a HP LaserJet P4015, A4 paper). all the dimensions are scaled up by a factor of roughly 2.  The PDF still paginates as if the font sizes/line heights were correct, but the actual printed lines are double size and truncated on the right and bottom edges.

What do I need to set to get the scaling correct?

Thanks,
Ross

#4 Re: mORMot 1 » Placing all sources in the same folder » 2015-12-21 23:46:40

OK, thanks for your comments.  Am I right in assuming that there is only one "unstable build" version of SynPDF.pas, and that is the same file as is present in http://synopse.info/files/mORMotNightlyBuild.zip?  In that case, if I wanted to use only SynPDF and SynGDIPlus, wouldn't I be better just to get the mORMot nightly build repo files and put that folder in my search path?

#5 mORMot 1 » Placing all sources in the same folder » 2015-12-21 20:58:25

rossmcm
Replies: 2

I notice that all the Synopse downloads share some files - SynCommons.pas being an example.  If I examine the datestamps and sizes of these files in each module however, they are different.

Why don't the individual projects (SynPDF, mORMot, SynGDIPlus, SynBigTable) all use the latest stable release of the common files?

I had originally planned to put all the files in one folder, to keep the number of folders in the search path to a minimum, but I'm now thinking maybe that would not be a sensible thing to do.  Does anyone have any comments please?

Thanks,
R

EDIT:  I see that SynGDIPlus is self-contained and only uses Delphi system units.

#6 Re: mORMot 1 » Are there any (really simple) examples of JSON encoding and decoding? » 2013-05-29 00:36:42

Thanks for replying.  I was intending the JSON to be human-readable, mainly because the data will then be in a format that can easily be read by third parties.  If I had a data type as described in my OP, and I had written a JSON file like this:

    {
    "MyRecord" : {
        "mrInteger" : 12,
        "mrString"  : "Hello",
        "mrArray1"  : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
        "mrArray2"  : [11.1, 12.2, 13.3],
        "mrArray3"  : [
            {
             "Field1" : 11,
             "Field2" : "A"
            },
            {
             "Field1" : 33,
             "Field2" : "B"
            },
            {
             "Field1" : 55,
             "Field2" : "C"
            }
          ]
       }
    }

then what would the code look like to parse this file and place the data into the same record structure that is was originally generated from?

Is this possible at all with the Synopse JSON routines?

Incidentally, I also implemented an XML serialiser for the data structure I am storing using the default Delphi XML document.  To save a 32 kbyte structure to a file took 120 seconds.  I recoded it to use Synopse JSON encoding and it now takes 0.14 seconds!  So you can see why I am keen to use the Synopse decoder as well.

Many thanks,
Ross

#7 Re: PDF Engine » App HALTING with SynPDF 1.16 (trunk) » 2013-05-26 20:38:19

I have just encountered a similar problem with PNGImage.  A trace of the error as supplied by MadExcept is:

      0086ffd9 +46cce9 app.exe    SynCommons     9380 +9272 Move
      00409e21 +000001 app.exe    Windows                   CopyMemory
      00545232 +0000b2 app.exe    pngimage       2237   +14 TChunkIHDR.Assign
      0054bb85 +0000f1 app.exe    pngimage       5304   +15 TPNGObject.AssignPNG
      00549d2c +000044 app.exe    pngimage       4413    +6 TPNGObject.Assign
      0048edbe +00002a app.exe    Graphics                  TPicture.SetGraphic
      0048f0f8 +000048 app.exe    Graphics                  TPicture.Assign

I found the error occurred when I was assigning one PNG image from another one in a collection component:

    GraphPngImage.Picture.Assign (PngImageCollection1.Items [2].PngImage) ;

but only if the source PNG image was not transparent.  Images with transparency did not generate an error.  I got past this one by commenting out this line (31055 in v1.17) of SynCommons.pas

    RedirectCode(GetAddressFromCall(@MoveInvoke),@Move);

but I too suspect the problem is in PNGImage.

Ross

#8 mORMot 1 » Are there any (really simple) examples of JSON encoding and decoding? » 2013-05-25 13:54:03

rossmcm
Replies: 3

I've decided to use the JSON routines in SynCommons.pas to serialize some data, but I'm unsure as to how to go about it.

I'm familiar with JSON syntax, but found the interface of the TTextWriter class a little daunting.

If I had a simple Delphi program fragment:

    procedure TForm1.Button1Click(Sender: TObject);

    type
        TMyDataType = record
          mrInteger : integer ;
          mrString  : string ;
          mrArray1  : array [1..10] of double ;
          mrArray2  : array of double ;
          mrArray3  : array of record
                        Field1 : integer ;
                        Field2 : char ;
                        end ;
          end ;

    var
        MyData  : TMyDataType ;
        W         : TTextWriter ;

    begin
    try
        W := TTextWriter.CreateOwnedStream ;

        ...???

        Memo1.Lines.Add (W.Text)  ;

    finally
        FreeAndNil (W) ;
        end ;
    end ;

What would the code in the missing bit look like?  I get the feeling you could do it all with one statement with routines that took open numbers of parameters, but I'm uncertain if this is the best approach.  Any advice appreciated!
TIA
R

#9 PDF Engine » Using Synopse PDF as a compression engine only. » 2012-09-20 03:49:00

rossmcm
Replies: 1

For reasons I won't go into, I'm stuck with an existing PDF generation tool for Delphi that produces PDFs OK, except they aren't compressed and it doesn't have that as an option.  I can achieve what I want by opening the PDF's produced in Acrobat Reader and then saving them again - the resulting PDF is 30% of the size it was.

My question - Instead of using Acrobat to compress the PDF dould I call a routine written using Synopse PDF to read the PDF file and then save it again with compression enabled?  That would be much less work than recoding all the reporting stuff in Synopse.

TIA,
R

Board footer

Powered by FluxBB