Using the Draw function to move logo

Modified on Thu, Feb 8, 2018 at 2:09 PM

In this example, we need to move the logo down to follow the paragraph. 

 

Do the following after you have fully created all the blocks.

Step 1 - The paragraph is bottom aligned so we need to search all the blocks to see how many lines there are in the paragraph. To do that we combined Tel and fax into one block using the place function and mobile and direct into another block using the place function. So the paragraph block will look like this: 

[Address_Block]

<avoidbreak<avoidbreak>{Address Line 1}<leading=8>{Address Line 2}<leading=8.5>{Numbers1}{Numbers2}{Email Address}{Web Address}

Once we have this we created another block to calculate how many lines there will be in the [Address_Block]. We called this [Move]. Inside of move we are using the empty function within the paragraph to look like this:

!empty {Address Line 1}^^{Address Line 2}^^{Numbers1}^^{Numbers2}^^{Email Address}^^{Web Address}%%.01%%-7.5%%-15%%-22.5%%-30%%-37.5%%-45 empty!

What this function says is, "If everything is being used then the value is 0, if 1 block is empty the value is -7.5, if two blocks are empty the value is -15 and so forth. The font size is 7.5 so we assume that the paragarph will decrease by 7.5 for every line that is missing.

The last step is the draw function inside of [Address_Block]

The value is the following:

image ref="left top" x1=0 y1=1+{Move} x2=79.2 y2=11.08+{Move}   image="~/Storage/3/13/0/Assets/Documents/88261_Hitachi_Consulting.pdf"

 ref="left top" | The logo's starting position will be based from the top left of the block. Everything will be calculated from that point.

 

image ref="left top" x1=0 y1=1+{Move} x2=79.2 y2=11.08+{Move}   image="~/Storage/41/307/0/Assets/Images/draw/Sample_logo.pdf"

x1 = 0 | X corodinate from the top left position which in this case is 0.

y1 = 1+ {Move} The Y position from the top left point. If this was 0 then it would be exactly where the block ended up. We wanted some cushion so we added 1 plus whatever the move is. So {Move} is the calculation of the lines. If all blocks are filled then Y1 would be 1 which means that the logo will be after the 6th line like in the original picture.

If there was 1 empty line then the y1 would be -6.5 which would be lower.

X2=79.2 | This is the size of the logo's width

y2=11.08+{Move} | This is the height of the Logo plus the calculation of emtpy lines.

image="~/Storage/41/307/0/Assets/Images/draw/Sample_logo.pdf" | This is the location of the logo in your resource folder.

Sample PDF

Final Working Template

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article