Free Support Forum - aspose.com

Insertimage image header design problems

I'm having problems designing this type of header:

(figure 1)
-------------[BEGIN HEADER SECTION]------------
-----------------------------------------------
------------------Header Title-----------------
-+-------------+---Text Text----+-------------+
-| |-----Text-------| |
-| image 1 |---Text Text----| image 2 |
-|_____________|-----Text-------|_____________|
-----------------------------------------------
-------------[END HEADER SECTION]--------------


I've been playing with the image1.tif placement but can't get it right.
This code results in the illustration in figure 2:
Builder.MoveToHeaderFooter 1
Builder.ParagraphFormat.Alignment = 1
Builder.Writeln "Header Title"
Builder.Writeln "Text Text"
Builder.Writeln "Text"
Builder.Writeln "Text Text"
Builder.Writeln "Text"
Builder.ParagraphFormat.Alignment = 0
Builder.InsertImage_6 "C:\Inetpub\wwwroot\image1.tif", 0, 0, 0, 0, 200, 100, 5, 0, False, Nothing

(Figure 2) is what I see. Shouldn't image1.tif be placed closer to "Header Title",
right after [BEGIN HEADER SECTION] since my LeftOrigin and TopOrigin are both 0?
Changing the cursor's position between the main document section
(builder.movetosection 0) and header section (builder.movetoheaderfooter 1)
results in the same problem. Which leads me to think that Apose.Word regards
leftorigin,toporigin of 0,0 after the end of the header section.

Can I set leftorigin, toporigin WITHIN header section so I can insertimage logos more precisely
while the picture is always on top of other text?



(figure 2)
-------------[BEGIN HEADER SECTION]------------
-----------------------------------------------
------------------Header Title-----------------
-----------------------------------------------
-------------------Text Text-------------------
---------------------Text----------------------
-------------------Text Text-------------------
---------------------Text----------------------
-----------------------------------------------
-------------[END HEADER SECTION]--------------
+-------------+--------------------------------
| |--------------------------------
| image 1 |--------------------------------
| |--------------------------------
|_____________|--------------------------------


Try to use

Builder.InsertImage_6 "C:\Inetpub\wwwroot\image1.tif", 1, left, 1, top, 200, 100, 5, 0, False, Nothing

Setting letfOrigin and topOrigin to 1 means that the positioning will be relative to page, not to paragraph and you will be able to set it where you want it independent of paragraph layout.