Search code examples
phphtml-parsingpdf-generationhtmldoc

HTML DOC --logoimage


I am trying to put different header and footer images while creating a pdf doc. The problem is i can not insert two different images using --logoimage command. I have tried different ways but have failed. The document which gets created picks up the last image i set using --logoimage, in the example below it sets the footer fine but header is blank and vice versa.

htmldoc --webpage --quiet --no-compression -t pdf12 --size "/home/test/bbb557c4886b2f1c840130eeef93b395.txt"

htmldoc --webpage --quiet --logoimage http://test.com/images/pdf/header.gif --header l --no-compression -t pdf12 --size -f "/home/test/bbb557c4886b2f1c840130eeef93b395.txt"

htmldoc --webpage --quiet --logoimage http://test.com/images/pdf/footer.gif --footer l --no-compression -t pdf12 --size -f "/home/test/bbb557c4886b2f1c840130eeef93b395.txt"


Solution

  • It seems as if we can not use separate images for header and footer through proper way. Anyways I found a work around finally which enables us to use different images.

    i used a proper logoimage in the header, however for the footer to work i found a way around. I actually used a background image, which is actually a full page length white image with a footer at the bottom. So once i use --bodyimage image.gif it behaves as if i am using a footer.

    htmldoc --webpage --quiet --logoimage http://test.com/images/pdf/header.gif --header l --footer --bodyimage http://test.com/images/pdf/footer.gif --no-compression -t pdf12 --size -f "/home/test/bbb557c4886b2f1c840130eeef93b395.txt"