officer icon indicating copy to clipboard operation
officer copied to clipboard

Issue with Footer in rdocx object

Open mayanklal opened this issue 3 years ago • 5 comments

On opening the file saved using print command, I am getting the error message saying that there is a problem with its contents. On checking further, I have identified that it is an issue with footer2.xml file.

I am using an existing docx file and adding external docx file to it. Both docx file doesn't have any footer in it.

The error message as given below:

Location: Part: /word/footer2.xml, Line:0, Column:0

Is it possible to remove the footer before saving it? Or any other way to fix this issue?

mayanklal avatar Apr 05 '21 14:04 mayanklal

Is it possible to recreate this with two empty or small documents and a short script? You should be able to drag all three of those into the comment window. It would be helpful in figuring out what's going on.

john-harrold avatar Apr 05 '21 14:04 john-harrold

Sure, I will do it and share the files.

On Mon, 5 Apr, 2021, 7:57 pm John Harrold, @.***> wrote:

Is it possible to recreate this with two empty or small documents and a short script? You should be able to drag all three of those into the comment window. It would be helpful in figuring out what's going on.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davidgohel/officer/issues/359#issuecomment-813420769, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBINO3JBJCCN2EMJ77SCX3THHCDRANCNFSM42M3Y6UA .

mayanklal avatar Apr 05 '21 14:04 mayanklal

PFA the DOCX files (Cover_Page_SP.docx and report_body_2.docx) that I am merging to generate the output DOCX File (Sample_Report.docx).

Also, the code that I have used to merge the two DOCX files:

report_s1 <- read_docx(path =  'Cover_Page_SP.docx')
report_s1 <- body_add_break(report_s1)
report_s1 <- body_add_docx(report_s1,src = 'report_body_2.docx')

print(report_s1, target = 'Sample_Report.docx')

report_body_2.docx Cover_Page_SP.docx Sample_Report.docx

mayanklal avatar Apr 06 '21 03:04 mayanklal

Hello,

Thank you both for reporting this. I can reproduce! I am not sure if it will be easy, as said, the issue is with the footer that need to be removed

davidgohel avatar Apr 19 '21 20:04 davidgohel

my mistake, the issue does not occur if the image is deleted.

davidgohel avatar Apr 19 '21 21:04 davidgohel

Closing the issue, I can't see any issue while running the reprex. and Opening a print dialog does not trigger any error message neither. So it's probably fixed by some other commits

davidgohel avatar Feb 03 '24 10:02 davidgohel