none
Word to PDF: Spaces converted to Tabs RRS feed

  • Question

  • Hi,

    I have a word doc which has spaces in between words like below: 

    Normal                   text                  with                  spaces

    Normal<3 tabs inserted>text<3 tabs inserted>with<3 tabs inserted>tabs

    When i save as PDF, the spaces gets converted to tabs. How can i retain the spaces? 

    Please advice. 

    Regards,

    Jescemine


    Friday, June 20, 2014 7:10 AM

Answers

  • It's not clear what your question has to do with programming using the Word APIs? This sounds more like an issue for an end-user forum?

    FWIW, though, I'm not sure there's any way to affect how the conversion to PDF is made in this regard. The only adjustments that can be made to the default appear in the "Options" list when you use File/Save As and choose PDF as the file type. For any other kind of conversion you need to look into software other than Word...


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, June 20, 2014 5:46 PM
    Moderator
  • My answer remains the same: There is nothing in the Word programming APIs that can affect how Word exports to PDF. It is possible that someone in an end-user forum may have an idea WHY Word would convert multiple spaces to a Tab, but you're unlikely to find that knowledge here, in a venue that specializes in the Word programming language.

    I can give you my best guess, though. PDF is a LAYOUT document format. The idea is that the layout should as closely as possible match how Word would PRINT the document. Creating space between letters (or words) by pressing the spacebar is notoriously inexact unless you're using a non-proportional font, such as Courier New. Mostly, these days, we use proportional fonts because the result "flows" better. But the space taken up by pressing the spacebar with a proportional font is not fixed.

    So, if it appears content should be in "columns" and multiple spaces have been used to generate the columns, it's quite likely that the converter is DESIGNED to calculate where each column starts, place a tab stop there and use TAB for the alignment rather than spaces, which could produce a "ragged" result.

    If my surmise is correct then you won't be able to get Word to produce a PDF document that retains the spaces. You'd need to find some other software to make the conversion that doesn't try to retain exact page layout, or that at least has the option to do a literal conversion.

    In any case, I don't understand how someone looking at a PDF file would know whether spaces or a tab has been used to separate the words in your example. If you say, "Well, I copied from the PDF file and pasted into Word" then there's yet another factor involved: how PDF is generating the content it puts on the Clipboard. And that has absolutely nothing to do with Word...


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, June 25, 2014 2:56 PM
    Moderator

All replies

  • It's not clear what your question has to do with programming using the Word APIs? This sounds more like an issue for an end-user forum?

    FWIW, though, I'm not sure there's any way to affect how the conversion to PDF is made in this regard. The only adjustments that can be made to the default appear in the "Options" list when you use File/Save As and choose PDF as the file type. For any other kind of conversion you need to look into software other than Word...


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, June 20, 2014 5:46 PM
    Moderator
  • Hi Cindy,

    Thanks for your reply. 

    Let me explain the problem again:

    I have a word document which has the following text

    I have saved this document to PDF using Word's Save As PDF feature

    Open the PDF in Adobe Reader, go to the line :

    Normal                text                  with                          spaces

    Place the cursor right after the text “Normal” and press the Right Arrow key(->) the cursor moves to the position before the word “text”

    So it appears that a tab has been used instead of a space.

    Users of the PDF usually look at the PDF and type the text accordingly, so in this case, they would end typing a tab instead of spaces.

    Please advise

    Wednesday, June 25, 2014 9:17 AM
  • My answer remains the same: There is nothing in the Word programming APIs that can affect how Word exports to PDF. It is possible that someone in an end-user forum may have an idea WHY Word would convert multiple spaces to a Tab, but you're unlikely to find that knowledge here, in a venue that specializes in the Word programming language.

    I can give you my best guess, though. PDF is a LAYOUT document format. The idea is that the layout should as closely as possible match how Word would PRINT the document. Creating space between letters (or words) by pressing the spacebar is notoriously inexact unless you're using a non-proportional font, such as Courier New. Mostly, these days, we use proportional fonts because the result "flows" better. But the space taken up by pressing the spacebar with a proportional font is not fixed.

    So, if it appears content should be in "columns" and multiple spaces have been used to generate the columns, it's quite likely that the converter is DESIGNED to calculate where each column starts, place a tab stop there and use TAB for the alignment rather than spaces, which could produce a "ragged" result.

    If my surmise is correct then you won't be able to get Word to produce a PDF document that retains the spaces. You'd need to find some other software to make the conversion that doesn't try to retain exact page layout, or that at least has the option to do a literal conversion.

    In any case, I don't understand how someone looking at a PDF file would know whether spaces or a tab has been used to separate the words in your example. If you say, "Well, I copied from the PDF file and pasted into Word" then there's yet another factor involved: how PDF is generating the content it puts on the Clipboard. And that has absolutely nothing to do with Word...


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, June 25, 2014 2:56 PM
    Moderator