Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Word 2010 Interop PDF Export missing border line

I have a strange issue ... I am using Word 2010 Interop, exporting a WordML document to PDF. There is a footer with top and bottom lines:

<w:pBdr>
  <w:top w:val="single" w:sz="8" wx:bdrwidth="20" w:space="0" w:color="auto"/>
  <w:bottom w:val="single" w:sz="8" wx:bdrwidth="20" w:space="0" w:color="auto"/>
</w:pBdr>

After opening document I use

            doc.ExportAsFixedFormat(
                outputFileName.ToString(),
                exportFormat,
                openAfterExport,
                optimizeFor,
                range,
                0,
                0,
                item,
                includeDocProps,
                keepIRM,
                createBookmarks,
                docStructureTags,
                bitmapMissingFonts,
                useISO19005_1
                );

to save as PDF. It saves fine, but the top and bottom lines do not show up in the footer. If I open the document manually with Word 2010 and use SaveAs/Publish, the lines are present. Any ideas?

like image 252
Darek Avatar asked Oct 20 '25 17:10

Darek


1 Answers

I found the solution the the issue.

Turns out that this setting:

application.ScreenUpdating = False

was the cause. It triggers a bug in Word that causes borders not to render.

like image 129
Michael Böckling Avatar answered Oct 23 '25 05:10

Michael Böckling