Processing
 

How to put a header and footer in Rails with gem htmltoword?

19/09/2016 05:08#1

Dvex

Member

Joined at: 5 months ago

Post: 1

Thank: 0

Thanked: 0

I have read the documentation of the gem, but do not see as putting a header or footer.

This is my first code:

format.docx {   render docx: "path_to/file.docx",   filename: "name_file-#{Time.now.strftime('%d-%m-%Y')}" } 

And my "path_to/file.docx.haml":

%html   %head   %body     %header       [..]     %content       %table[..]       %h1 [..]       %p [..]     %footer       %p       %ul         %li       [..] 

And my other code is:

format.docx {   render docx: "path_to/file.docx",   filename: "Proforma-#{Time.now.strftime('%d-%m-%Y')}",   header: {      :content => render_to_string({ template: 'path_to/header' })   },   footer: {      :content => render_to_string({ template: 'path_to/footer' })   } } 

And my "path_to/file.docx.haml" only have the %content tag.

Then I have my other templates: "path_to/header.haml", "path_to/footer.haml".

But neither one works for me . How could generate a word with header and footer correctly?

19/09/2016 05:15Top#2

Joined at: 5 months ago

Post: 1

Thank: 0

Thanked: 0

This gem currently does not support this feature (neither header nor footer). See this thread here

Similar articles

VBA regex matching over two lines

5 months ago - Reply: 1 - Views: 44

Table output to Word-2011 from Rstudio using knit

5 months ago - Reply: 0 - Views: 44

Write a Collection of paragraphs into a new document

5 months ago - Reply: 1 - Views: 72

how to write paragraphs without show to document

5 months ago - Reply: 1 - Views: 67

numericals in word macro

5 months ago - Reply: 1 - Views: 46

Can not find proofing tools

5 months ago - Reply: 0 - Views: 2

Possible values for <w:outlineLvl> in Word OOXML

5 months ago - Reply: 1 - Views: 8

C# restrict editing partial word paragraph

6 months ago - Reply: 2 - Views: 146

Macro translation Please (possible virus)

5 months ago - Reply: 1 - Views: 35

Doc/Docx Fastest Reading Method for Searching

5 months ago - Reply: 0 - Views: 3

Save embedded file / content from word

5 months ago - Reply: 0 - Views: 6

Counting words in Word document, including footnores

5 months ago - Reply: 1 - Views: 24

c# access extract word ole object

5 months ago - Reply: 1 - Views: 23

Using word wildcards to find unaccepted changes

5 months ago - Reply: 1 - Views: 46

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re