Image Placement
-
Hello there,
I’ve had success placing a logo header on the 1st page of my document.
Now I would like to insert the same logo mid rage of my document on the 5th page. I’ve tried css and no luck. FYI i do have a page break between separating page 4 from page 5. Have any idea’s on hw to do something like this?
-
By the way I am using the fault template.
Hi,
This is a bit tricky to accomplish.
There are two options:
1. Add a HTML field to your Gravity Form and position it in the form so it is displayed on the 5th page of the PDF. To get HTML fields to show up in the default template you need to set the
default-show-htmloption to true in your configuration.php file. Any HTML fields you don’t want shown can be excluded by adding the class nameexcludeto those fields in the Gravity Forms editor.You’d then have to add a class to the aforementioned HTML field which has a
display: noneCSS property assign to it (so the HTML field isn’t displayed to the user while filling out the form.2. The more complex solution is to use mPDF’s
Named @page selectorsto set a custom header on page 5. The process requires you have an understanding of how the@pageselector can set and display headers.I went with the 1st option you suggested.
1 -> I Added the HTML field where I wanted it to be
2 -> Uncommitted the “default-show-html” within the config file.
Question Here is:
3 -> I know how to add the class to a file but which file to a make the changes to so that I can specify the class name on via Gravity form HTML text CSS reference?
4 -> Do I just do the following within the html text field: <img src= “location”> ?I did some more digging and I was able to get the image to appear on the form of the “template=default-template.php&data=1” but unable to get it to show on the PDF. I wanted to know if I am doing something wrong?
Some web hosts have trouble displaying an image in the PDF via a URL. You can try use an absolute path to your image in your
<img src="" />tag. That should get it to display correctly in the PDF.No luck. I was able to use the absolute path and nothing appeared where it should.It works when on the gravity forms itself and within default-template.php&data=1. However, I am still unable to view within the PDF.
If I was in your position I would try modify the PHP PDF template file directly and play around with URL, absolute and relative paths to your image until you get it working. Then copy that to your HTML and retest.
Wonderful I got it working. I found that the HTML Field is not appearing within the PDF. Is this a bug or something?
There should be no bug, provided you updated the configuration.php file correctly and enabled the
default-show-htmlon the correct form ID.This was what did:
$gf_pdf_config[] = array(
‘form_id’ => 5,
‘template’ => ‘default-template.php’,
‘default-show-page-names’ => true,
);
Uncommented.That configuration node has
default-show-page-namesset to true notdefault-show-html. Once you swap that over the HTML should show up in your PDF.Still No luck even after debugging. I did the following.
1. Modified the Config file.
$gf_pdf_config[] = array(
‘form_id’ => 5,
‘template’ => ‘default-template.php’,
‘default-show-html’ => true,
);
Still unable to view the HTML image.
After reading the documentation again just no luck.
Have any ideas as to why this is not working or am I forgetting something to do?Are any other HTML fields you have in the form showing up? If you don’t have any other HTML fields in your form try add them and view the PDF again. If those text-based HTML fields aren’t showing there is still a problem with your configuration. I would check that you don’t have two active nodes for form #5: eg 2 x
$gf_pdf_config[] = array('form_id' => 5,I only have one HTML field with in my form that is still not showing up on the generic PDF (default-template.php) even after rebuilding my test site. There is only one active node set to the page ID for the form that I need to generate.
The gravity form HTML has the following code inserted with in the content box:
<img src=”http://MyTestsite.com/wp-images/HeaderLogo.jpg” />Here are my warnings that appear while debugging:
Warning
: Missing argument 3 for GFPDFEntryDetail::do_lead_detail_grid(), called in
…/wp-content/uploads/PDF_EXTENDED_TEMPLATES/default-template.php on
line 79 and defined in
…/wp-content/plugins/gravity-forms–
df-extended/helper/pdf-entry-detail.php
on line 53
Notice
…wp-content/plugins/gravity-forms-pdf-extended/helper/pdf-entry-detail.php
on line 68
Warning
: array_merge(): Argument #2 is not an array in
…/wp-content/plugins/gravity-forms-pdf-extended/helper/pdf-entry-detail.php
on line 68Have any ideas with the information that I have provided for you?
Can you try delete the PDF_EXTENDED_TEMPLATES directory and use the reinitialise button from the Forms -> Settings -> PDF page and see if that helps? You have be using an older PDF template for some reason.
The topic ‘Image Placement’ is closed to new replies.