Extra line in header for resulting PDF

May 18, 2015 at 5:30 AM
Hi,

This is such a great conversion tool, thank you!
I am seeing though with some of my documents that the resulting pdf is slightly different from the pdf created with "Save As" from Office.
Specifically here, it seems to be a blank line before everything- which doesn't seem like a big deal except it's making the resulting file show up on two pages instead of one, for example.
Image
The values for the options are the default ones. I did try changing a couple of them (excludeprops and excludetags set to true) but not seeing any difference.
Does anyone have any suggestions on where I should be looking at to debug this issue?
Many thanks!

Maria
Coordinator
May 18, 2015 at 8:42 AM
Hi Maria

Thanks for the kind comment!

Could you let us know a few things about your environment:
  • What version of Word are you using
  • When you "Save as" PDF, are you doing so on the same PC you're running OfficeToPDF.exe on?
  • If the problematic documents are .docx (or .docm) files, do you see the same behaviour if you save as .doc and then convert with OfficeToPDF?
  • Would it be possible for you to attach an example document for us to examine (or email one to opensource@cognidox.com)?
Regards
Vittal
May 18, 2015 at 6:36 PM
Thank you so much for your fast response!

Here is more info:
  • What version of Word are you using:
    Office Professional Plus 2010 (Word version is 14.0.7149.5000 64 bit). It is a trial, but I don't think that should make a difference, trial is not expired yet.
  • When you "Save as" PDF, are you doing so on the same PC you're running OfficeToPDF.exe on?
    Yes, same PC.
  • If the problematic documents are .docx (or .docm) files, do you see the same behaviour if you save as .doc and then convert with OfficeToPDF?
    The files I am testing with are actually rtf files. But, I did get the sample file, saved it as doc, and tried the conversion to pdf and still got the extra line in the header.
  • Would it be possible for you to attach an example document for us to examine?
    This is a sample file
I am also in the process of trying it on a different environment, that has Office Professional Plus 2013, see if I am still having this one issue.
Thank you for your time and help!

Maria
Coordinator
May 19, 2015 at 10:55 AM
Hi Maria

What's happening is that Word appears to be adding extra space between the header and the top of the page and also the footer and the bottom of the page, and ignoring the settings in the actual RTF document.

Try the linked copy of OfficeToPDF.exe which allows you to control the header and footer distances with the /word_header_dist and /word_footer_dist switches:

https://www.dropbox.com/s/hw6fj6qmz5034n7/OfficeToPDF.exe?dl=0

e.g.
officetopdf.exe /word_header_dist 0 /word_footer_dist 0 sample.rtf sample.pdf
Regards
Vittal
Marked as answer by mariutza123 on 5/20/2015 at 9:11 PM
May 21, 2015 at 4:11 AM
Hi Vittal,
This is great! I tried the new executable and the extra space is no longer there. So with this change, it will keep whatever setting is in the rtf/doc, right? Meaning there wouldn't be any scenario where we would need this value to be something else other than zero.
Thank you again very much for taking the time to help me with this!

Maria
Coordinator
May 21, 2015 at 11:20 AM
Hi Maria

With a bit more digging I think I've found the root cause of the problem. It seems that when we run through the headers and footers on a document to update the fields, empty headers/footers can be created by Word which can add unexpected whitespace (which is what you're seeing).

Anyway, I've made another change in the build below. You can run it without the word_header_dist and word_footer_dist switches and it should handle files as expected.

https://www.dropbox.com/s/hw6fj6qmz5034n7/OfficeToPDF.exe?dl=0

Regards
Vittal
Marked as answer by mariutza123 on 5/21/2015 at 9:27 PM
May 22, 2015 at 4:29 AM
Works great, thank you!

Maria
Coordinator
May 22, 2015 at 8:40 AM
No problems Maria; glad it works for you.

Regards
Vittal
Oct 14, 2015 at 11:32 AM
Hello Sir,

Many thanks for this new version. I don't have any header problem.

Best regards.
Feb 29, 2016 at 9:29 AM
Hello,

I had same problem (extra header line added on documents with officetopdf 1.5 version). This exe fixes the problem easily. Maybe, you should consider putting this exe as 1.6 or 1.5.1 version.

Thank you very much for this really nice piece of software.

Best regards.
Coordinator
Feb 29, 2016 at 10:44 AM
fab4codeplex wrote:
Hello,

I had same problem (extra header line added on documents with officetopdf 1.5 version). This exe fixes the problem easily. Maybe, you should consider putting this exe as 1.6 or 1.5.1 version.

Thank you very much for this really nice piece of software.

Best regards.
Thanks for the feedback.

We're working on another couple of issues, but once they're done, we'll push out a new stable release.

Regards
Vittal
Coordinator
Mar 21, 2016 at 10:41 AM
fab4codeplex wrote:
Hello,

I had same problem (extra header line added on documents with officetopdf 1.5 version). This exe fixes the problem easily. Maybe, you should consider putting this exe as 1.6 or 1.5.1 version.

Thank you very much for this really nice piece of software.

Best regards.
FYI, we've now released version 1.6 that includes the updates for the header/footer spacing.
Marked as answer by cognidox on 3/21/2016 at 3:42 AM
Jun 8, 2016 at 2:40 PM
Edited Jun 8, 2016 at 2:43 PM
Hello!
First of all, thank you for all your time and effort put in this project.
I would really like to use this exe in my script but i am encountering a similar issue as the others.
In the left side is the pdf generated with the exe and in the right side it's saved from word.
The issue is that on some documents that have more than one page, at some point a paragraph appears on the next page, so i believe that the issue may be the size of header.
I used the OfficeToPDF.exe version that you uploaded here but that doesn't do the trick.

SCREENSHOT
I would really appreciate if you could help me with this issue.
Thank you in advance!

Best regards,
Georgiana
Coordinator
Jun 8, 2016 at 3:19 PM
Edited Jun 9, 2016 at 9:04 AM
Hi Georgiana

Please try with the latest current stable release (from the "Download" link on http://officetopdf.codeplex.com/) and see if that works.

If it doesn't we would need to examine some sample source documents that exhibit this problem to see if there's a solution to the problem.

Regards
Vittal