Add a background image to a Form

  • Is it possible to add a background image to a form (watermark) that will apear on all pages printed?

  • I have a multi page form and want a different background image for each page. I used to be able to extract a background from a PDF file using wPDF but it does not seem to work very well any more. Is there a better way to do this?

    I have D7 and all the latest versions of WP Tools, WP Forms, wPDF and wPDF Viewer. After spending the better part of the day going through the documentation I am getting very confused!

    I don't want a "watermark" or the "master page". I want a separate high resolution image for each page of my form. The help for the "AddPageData method" looked very suggestive with regards to getting info from a pdf, but I can't quite figure out how it is all supposed to work.

    The previous version of my software used an older version of your components and I used the PDFPagesImport component with success. I have it enabled again, but clearly you want us to use some other method to achieve that same functionality. What is it?

    Many thanks, Rob

  • I developed a function which does what You need.
    It uses a temporary TWPViewPDF component to load a PDF file and setthe page images as the background in WPForm.

    Julian

  • Thanks, that is getting me really close to what I want!

    1. I took the liberty of adding "DeleteFile(fname);" right after "meta.Free;"

    2. There is a subtle metafile scaling problem. The background image is about 5 - 10% too big and it overflows the right hand edge of the page and the fields that I have laid out no longer line up properly with the background image. From reading the documentation I know that scaling conversions sometimes have to be made when dealing with these images but I am not quite sure how to proceed in this case. Do I need to do something with FD.AddPageData(i).Page.Pagewidth?

    Thanks for the very speed reply to my first post.

    Cheers, Rob.

  • Well I still can't get it to work. The line "meta := PDFViewer.GetMetafile(i);" keeps throwing range check errors about 90% of the time. I have played with every setting that I can find and tried various work arounds / completely different methods and I am still stuck.

    I was able to get this functionality out of the previous versions of these tools but I am stumped now with the current versions.

    To recap: I am trying to fill out multi-page forms on screen. I want to load a page-specific image from a pdf file to act as a background while filling the form, and then I want to save the page-specific background with the completed form so that Adobe Reader can view it as a complete filled form later. Right now I can't get it to do either of these background image functions even though I used to be able to with D5 and the WPCubed components from 2 years ago.

    I have tried to export the pdf image as an emf file and then load it up again when I need to fill a form but I am having terrible difficulty understanding the various help files and code snippets. They seem to have been written at different times and it is very hard to tell how the components are supposed to work together now.

    Can you point me in any particular direction?

    Thanks, Rob