5

I am working with MS Word and there are quite a few places where I care about the final look of the document. I don't want to split certain parts (for example pasted source code). I also don't want to turn those parts into Objects, because while it would keep them unseparated, it will frequently add padding whitespace in the document around them. Web Layout works okay for development, but ultimately I will be exporting the document to PDF. I would like the resulting PDF to be just one long page.

How can I export an MS Word document to PDF so that the resulting file will contain just one page (result of merging all the pages, without seemingly random header and footers between the content)?

8
  • Save the document as a PDF then configure the page size within Adobe Acrobat.
    – Ramhound
    Feb 18, 2022 at 2:26
  • @Ramhound is that option available in the free version?
    – Fureeish
    Feb 18, 2022 at 2:42
  • No , but in Acrobat Pro, under Edit PDF, there is an option to have one page. That should help you.
    – John
    Feb 18, 2022 at 2:48
  • @John thank you. I will try to acquire the pro version with my company's license and get back to this question to post an update.
    – Fureeish
    Feb 18, 2022 at 2:54
  • 2
    The maximum size for a Word page is 22" x 22". If that meets your needs, you can just set the Word page within that size and save as pdf. Feb 18, 2022 at 3:38

2 Answers 2

5

I don't think that the PDF editor solution will give you a truly single continuous page. I think it'll still contain page breaks.

Instead there's a different way to go about it.
First you'll need to convert word document to HTML. I liked this online service for this purpose, but you could also use pandoc to convert the docx to html, e.g.:

pandoc --extract-media='media' -s your_file.docx -t html -o your_file.html

Then, from HTML, you'll need to convert to a truly continuous single paged PDF. It can be done like so:

  1. Get wkhtmltopdf - https://wkhtmltopdf.org/downloads.html (Don't forget to add on PATH!)

  2. Open terminal and execute

    wkhtmltopdf -T 0 -B 0 --page-width 210mm --page-height 594mm input.html output.pdf
    

    Here, change the --page-height parameter to (297*Number of A4 pages) in your word document. For example, for 2 A4 pages it becomes 2*297 = 594mm

For more complex files containing extra files, extract the .zip first, then use

wkhtmltopdf -T 0 -B 0 --page-width 210mm --page-height 594mm --enable-local-file-access input.html output.pdf
7
  • I have done exactly as you suggested, but the resulting PDF is blank. I successfully converted the PDF into HTML, but the wkhtmltopdf invocation results in a 2KB empty PDF. Do you have any suggestions as to why did that happen and how to fix it?
    – Fureeish
    Feb 18, 2022 at 14:43
  • I found this discussion and by specifying --print-media-type option I got the resulting PDF to not be blank, but contain a single image and a line marker for the footer. No text or any other content, though.
    – Fureeish
    Feb 18, 2022 at 14:51
  • @Fureeish This is really wierd. However it seems like a separate problem. I was successful at making a single-paged pdf using this. Example Feb 18, 2022 at 14:59
  • @Fureeish Oh wait..... I think, did you forget to replace input.html with your file name? That'll give you an empty PDF... Feb 18, 2022 at 15:00
  • No, I replaced all of the names. Like I said in my second comment, by specyfing an additional option I managed to have a single-paged PDF with an image of my original document, but without any other elements. I looked at your example and your .html consists of very simple tags. Seems like wkhtmltopdf doesn't handle correctly all the elements. Have you tried converting a document that consists of multiple formatting, tables and images?
    – Fureeish
    Feb 18, 2022 at 15:09
-1

I have a simple solution:
Convert to normal PDF
Upload PDF to https://foxyutils.com/mergepdf/

1
  • No. The result will be NOT a 1-page document.
    – MarianD
    Feb 18, 2022 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.