#1 PDF Engine » Problems with unicode characters » 2017-07-27 23:11:18

SoftTech
Replies: 0

I'm using the HTML components from https://delphihtmlcomponents.com/welcome.html and am having problems generating a PDF file, which uses SynPDF to do its work.

I am using the following characters within the report:

✱◆

They are being ignored when being rendered.  I've tried just about everything.

Any ideas??

#3 Re: mORMot 1 » Memory Leak with TDocVariantData » 2016-02-23 19:25:38

Perfect!  I'm going to declare victory and go work on something else instead.

Thanks for your support!  I can live with converting from functions to procedures.  I can't live with the enormous memory leak I was experiencing in a routine called pretty frequently.

#4 Re: mORMot 1 » Memory Leak with TDocVariantData » 2016-02-23 15:49:48

I did read the article you pointed me to...  please note the init call...

Very very strange!  I converted all of my functions to procedures precisely like what you show and the memory leak disappears completely.

I don't understand this at all and I tried to create a small project that used functions just like what I've shown you.  That project did not leak.

Is it time for me to declare victory and rely on the procedure instead of the function or do you have any other ideas?  I'm really thrown for a loss!

Another question - when I use dvoValueCopiedByReference am I passing around the entire structure on the heap or am I passing around just a pointer to memory?  I'm hoping that it's the latter...

#5 Re: mORMot 1 » Memory Leak with TDocVariantData » 2016-02-23 14:25:04

I got rid of the Try...Finally...End.  Every one of these methods are being implemented as something like:

function TSomethingOrOther.CreateDocVariantDataObject: TDocVariantData;
begin
  Result.Init([dvoValueCopiedByReference]);
  Result.AddValue('Something', 'Value');
  Result.AddValue(Whatever, YetAnotherObject.CreateDocVariantData);
end;

function TYetAnotherObject.CreateDocVariantData: TDocVariantData;
begin
  Result.Init([dvoValueCopiedByReference]);
  Result.AddValue('SomethingElse', 'Another Value');
end;

#6 mORMot 1 » Memory Leak with TDocVariantData » 2016-02-23 01:06:40

SoftTech
Replies: 6

I am creating hierarchical data using TDocVariantData and it seems to be working fine, but when I exit the system I have numerous memory leaks that seem to be directly attributable.

The relevant code is below.  I couldn't find a better way, using TDocVariantData, to add data to create the hierarchy.  The call to Clear is *NOT* cleaning up the memory and I can't figure out how to go about writing my own that does the cleanup for me.

Any ideas??

procedure SomeProcedure;
var
  DocVariantData: TDocVariantData;
  LocalImageCacheItem: ILocalImageCacheItem;
  BillingCodes: String;
begin
  DocVariantData := SomethingOrOther.CreateDocVariantData;
  Try
    SomethingElse.AddToDocVariantData(DocVariantData);

    For LocalImageCacheItem In TLocalImageCache.List Do
      If LocalImageCacheItem.ImageName.StartsWith('Embed_') Then
        DocVariantData.AddValue('Image:' + LocalImageCacheItem.ImageName,
                                LocalImageCacheItem.BitmapAsURL);

    BillingCodes := SomethingElse.BillingCodes;
    If BillingCodes <> String.Empty Then
      DocVariantData.AddValue('Billing:Codes',
                              BillingCodes + String.Empty);

    DocVariantData.AddValue('DataObjectAttribute:Values',
                            Variant(AnotherObject.CreateDocVariantData));

    //TFile.WriteAllText('Debug.json', String(VariantSaveJson(DocVariantData)));

    // Other stuff happens...
  Finally
    DocVariantData.Clear;
  End;
end;

#7 Re: mORMot 1 » Problem with Mustache » 2016-01-19 23:00:30

I sent you one (well, actually two) back

#8 Re: mORMot 1 » Problem with Mustache » 2016-01-19 15:45:45

I should probably mention that I am afraid that I cannot provide the template and data that fails as it is proprietary.  If you must have it, I might be able to provide it with the proviso that I email it to the one developer responsible for Mustache issues such as this.  Please contact me with an email address if this is necessary.

#9 mORMot 1 » Problem with Mustache » 2016-01-19 15:43:32

SoftTech
Replies: 4

Reference Ticket #ae3a3aff807019b9dbed049aadcf01808bc49ae7

Yes, I can plainly see that it passes the simple regression tests just fine.  However, I have a much more complex template and Json data that I am passing in that has several levels and the mustache processor seems to lose its context and find only the first element within lists when it is looking at data that isn't top-level Json.

I am unsure if the problem is with Json Arrays or Json Key-Value pairs.  I believe it to be with Arrays, but am not certain.

Board footer

Powered by FluxBB