Images in letter heads (document size)

    • Offizieller Beitrag
    Zitat

    I am using an image in some of my templates as a 'letter head' type image. It's set as a linked image. Without an image the
    document is roughly 3k. But when I link a 21k jpg into the document, the
    document size jumps to 100k. Is there a way to keep this size down? I may be pulling 40-50 or more of these reports at a time and 100k each adds up pretty quick.

    Using a linked image is good to reduce the size of the document but here it seems so that the image was not linked. The size should be only some 100 bytes for the object place holder. Please check the setting for the property WriteObjectMode if it is set to 'both' or 'rtf'. It should be set to 'standard' for smallest files.
    Please note that linked images use the property 'StreamName' and not 'FileName' as reference to the image. The image is loaded from the same path as the document or provided in the even OnTextObjectLoadStream.

    Julian

  • OK I'm using

    Code
    WpRichText1.InsertGraphicAsLinkDialog('Graphic files|*.BMP;*.JPG;*.GIF');


    to insert the image. This was taken from one of the demo apps.

    WPRichText1.WriteObjectMode is set to wobStandard

    Is there something else I might be missing?

    In my application, these templates are loaded from a file and the resulting documents are saved to a memo field in a db. I have set up a shared directory for all the images I want to use so the path is constant across the multiple applications at play here. Everything seems to work fine, just the file is big. I can send an example if you like.

    Just for reference, the resulting 'link' in the rtf as plain text looks like an embedded binary, but is a good bit smaller, but still 20+ lines of jibberish code. I guess I was expecting to see something like ImagePath='blahblahblah' or something.

    • Offizieller Beitrag
    Zitat

    Just for reference, the resulting 'link' in the rtf as plain text looks like an embedded binary, but is a good bit smaller, but still 20+ lines of jibberish code. I guess I was expecting to see something like ImagePath='blahblahblah' or something.

    You see the properties of the embedded object encoded in a binary stream. It seems to be correct.

    Julian

  • That's because it is correct heh. The template I was having a problem with was one I had made using embedding and never went back and did it as a linked image, thus the monstrous file size. Problem resolved. Now it's only 8k, and that is very useable. Thanks again.