Keep background static relative to controls

T

Tarah

I am trying to create a form as follows:
We have a number of forms internally that are sent, once completed, to our
providers. Currently these are kept in pdf format, printed, completed by
hand, and sent by post or faxed.
I would like to use the existing form as a background, and create an
InfoPath form over the top, so that the users are working with a form that
they are familiar with, the data can be stored in our own database, and the
form can then be printed and sent out.
The problem I am having with this is that if I put the controls over the
appropriate places in design view, they don't remain in the same place
relative to the background in print preview.

Can anyone tell me if there is a way of achieving this short of aligning
every item by trial and error, or if I should approach this task from a
different direction?

Thanks,
Tara
 
B

Brian Teutsch [MSFT]

It's a little unclear what you mean by "they don't remain in the same place
relative..."

Are you using layout tables to position your new controls, or are you using
spaces to push items on top of the current "form". If you use layout tables,
those won't change sizes, and you should be able to acheive just what you
want, a background of your old form with just InfoPath controls on top.

Brian
 
T

Tarah

Brian,

Thanks for the reply.

I'll try and be a little more clear:
Since there doesn't seem to be a way of stretching or shrinking a picture to
fit, I imported the scanned picture into Word, resized it to cover the entire
page, copied and pasted into Paint, and resaved. I then set this as the
background by Format, Background Colour, Use a Background Picture.
(Incidentally if anyone could tell me a better way of doing this I'd
appreciate it!)
I have used a layout table to sit the controls over the relevant areas on
the form. In Design view, it looks fine, and the controls sit where they're
supposed to, but when I go to print preview, the controls 'shift' relative to
the background, about half a centimetre up, and the same to the left.
I suspect it has something to do with the page margins, since I had to set
them to 0 to get the background to fit, but if I change them it affects both
the background and the control layout table.

I hope this is a bit clearer - sorry for so long in replying, my original
reply got lost in posting.

Thanks,
Tara
 
B

Brian Teutsch [MSFT]

Without playing with your form, it's a little hard to say exactly what is
throwing off the layout. Firstly, layouts can shift a few pixels betwen
designing and editing a form (using Print Preview from the designer isn't a
good way to test layout). Secondly, InfoPath isn't a pixel-perfect design
surface. You will probably run into more than a few errors if you're trying
to line things up "perfectly".

But it sounds like the source of your problem is using the designer's print
preview. Test things out by previewing in the Editor, and see how things
work there.

Brian
 
T

Tarah

Hi Brian,
I assume when you say "Test things out by previewing in the
Editor" you mean click on 'Preview Form'? I have tried this and it appears
fine, the controls remain where they should. The issue, though, is that the
reason for creating the forms in this way is so that they can ultimately be
printed out and sent off. If the print preview (and subsequently print) does
not behave like the form preview, it would appear that what I am trying to
achieve is not possible. Is that true?

Thanks,
Tara
 
B

Brian Teutsch [MSFT]

Print Preview while you are designing a form isn't intended to be as robust
as you're expecting. "Preview Form", and Print Preview while you're
Previewing the form (or filling it in) are expected to be more accurate.
Those are the cases where your useres will filling and printing forms, not
using Print while designing the form.

Sorry that your expectations are different than what we presently have, but
hopefully you can still get good layout.

Thanks,
Brian
 
T

Tarah

Hi Brian,

Thanks again for the reply. If I understand you correctly, you are saying
that Print Preview will behave differently when in Design View than in 'Fill
out a Form' view. I would only need it to print accurately from filling out,
as opposed to from designing, however there does not appear to be any
difference in the behaviour as far as I can see.
If I select 'Fill out this form', enter some data, and then print preview, I
still see the same 'shift' as previously.
Would it help to create a sample form that I could send to you so that you
could have a look at it yourself? I would have to make a new form since the
existing ones are confidential.

Thanks,
Tara
 
B

Brian Teutsch [MSFT]

Thanks for the offer to send. I went ahead and took a look. It looks like
something is going wrong in the CSS styles that InfoPath uses. We require a
21px left border to allow the widgets for repeating things to show. The
background image is supposed to be pushed off by 21px on the screen. And
that 21px is supposed to be gone at print time. Unfortunately, something in
our CSS is pushing the document content 21px from the left, but not padding
the background-image (even thought it's in the CSS...)

Right now, I think you'll have to either put that padding onto your image.
Unless you hand-author your CSS to have two different images, it's still
going to be off for either screen or printing.

Sorry this isn't working out. Hopefully I'll have a better solution for this
in the future.

Brian
 
T

Tarah

Brian,

Really appreciate your help on this one! It's great to have an answer that
makes sense. Now it just comes down to the issue of whether I can tweak the
css so that it behaves as we need, and whether it's worth doing it for all
the forms.
Again, much appreciated, thanks for your time.

Tara
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top