Image scale

Asked by mindaugas

Images with different dpi are not scaled.
If you have two identical images, but dpi is different and you insert images in document using OO writer,
you see images in different size (image with larger dpi is smaller),
if i try to add images with different dpi using appy.pod (do text from document(...)), images are still the same size.

How can i solve this problem?

thanks for help

Question information

Language:
English Edit question
Status:
Solved
For:
Appy Edit question
Assignee:
No assignee Edit question
Solved by:
Gaëtan Delannay
Solved:
Last query:
Last reply:
Revision history for this message
Best Gaëtan Delannay (gaetan-delannay) said :
#1

Hello,
Did you try using parameters "size" and "sizeUnit" of method "document" as explained below?
Gaetan

    def importDocument(self, content=None, at=None, format=None,
                       anchor='as-char', wrapInPara=True, size=None,
                       sizeUnit='cm', style=None):
        '''If p_at is not None, it represents a path or url allowing to find
           the document. If p_at is None, the content of the document is
           supposed to be in binary format in p_content. The document
           p_format may be: odt or any format in imageFormats.

           p_anchor, p_wrapInPara and p_size are only relevant for images:
           * p_anchor defines the way the image is anchored into the document;
                      Valid values are 'page','paragraph', 'char' and 'as-char';
           * p_wrapInPara, if true, wraps the resulting 'image' tag into a 'p'
                           tag;
           * p_size, if specified, is a tuple of float or integers
                     (width, height) expressing size in p_sizeUnit (see below).
                     If not specified, size will be computed from image info.
           * p_sizeUnit is the unit for p_size elements, it can be "cm"
             (centimeters) or "px" (pixels).
           * If p_style is given, it is the content of a "style" attribute,
             containing CSS attributes. If "width" and "heigth" attributes are
             found there, they will override p_size and p_sizeUnit.
        '''

Revision history for this message
mindaugas (mindaugas-mx) said :
#2

Thanks Gaëtan Delannay, that solved my question.