         
         # add current font to page if necessary
         @page.fonts[@_font.id] ?= @_font.ref
+        
+        # if the wordSpacing option is specified, remove multiple consecutive spaces
+        if options.wordSpacing
+            text = text.replace(/\s+/g, ' ')
         
         # word wrapping
         if options.width

        
        # Word spacing
        @addContent wordSpacing + ' Tw' unless wordSpacing is state.wordSpacing
        
        # add the actual text
        @addContent "(#{text}) Tj"

        # split the line into words
        words = text.match(WORD_RE)
        
        # calculate the extra width
        wrap.extraSpace = (options.wordSpacing or 0) * (words.length - 1) +   # wordSpacing
                          (options.characterSpacing or 0) * (text.length - 1) # characterSpacing
        
        # space left on the line to fill with words
        spaceLeft = lineWidth - indent - wrap.extraSpace
        
        # word width cache
        wordWidths = {}
