Puzzlepart/spfx-solutions

PDF export: Save as PDF creates a pdf document but SharePoint thinks its a docx

Opened this issue · 9 comments

I am experiencing some issues where the "Save As" function will create a file with the filetype docx, but if i download the file it opens up fine as an pdf.

This results in not being able to open the file without downloading it first.

1

wobba commented

@jt-roesgaard If you upload another pdf, does it experience the same issue? Either way seems to be a SharePoint issue, not an issue with this extension. If you download "1.pdf", the file is named "1.pdf" correct?

I cannot repro myself, tested in Chrome.

@wobba It does not. It gets registered as a pdf as usual. It is not all documents that fails like this. I agree that it is SharePoint that forces the wrong filtype onto it, but it may be when the pdf is "created"?

Yes if i download "1.pdf" it is still called "1.pdf" and opens normally.

3
1.docx = original document
1.pdf(.docx) = converted to pdf
2.pdf = same as 1.pdf but downloaded and re uploaded
3.pdf = completely separate pdf document

It is the same issue both if i use Chrome or New Edge

wobba commented

If you click the item "1.pdf", and open info panel, is it listed as "1.pdf" or does it have some docx reference? Do you have PnP PowerShell available and can check all the properties for the file, to see which one has the "wrong" value?

It is listed as "1.pdf" but the "Type" states "DOCX"

File Name: 1.pdf
Last Modified: 2020-10-12 10:21:47
File Size: 145979
File Type: docx

This is what i get from the fileinfo through PnP

wobba commented

Interesting, and I'll see if it's possible to set the value of this field explicitly.

Hi @wobba - happy new years. Just seeing if you had any updates to this trouble?

wobba commented

@jt-roesgaard Added a potential fix but haven't been able to repro. In PR #30 or get my build directly from https://github.com/wobba/spfx-solutions/blob/wobba/fix/27/Pzl.Ext.PDFExport/pzl-ext-pdf-export.sppkg

Thanks - we will try it out. I'll report back

@wobba Seems like the problem has magically disappeared, for now. I'll add the new code if the issue rises again