Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Jun 02, 2020 2:34 pm

Hello,
I'm converting a docx file to pdf using Spire.doc. Conversion works fine except a strange behavior when using a page break inside a table.
Spire.Doc does not recognize such page break and the next page is being hidden inside the previous table cell. I've converted the same document successfully with MS Word, which has created a pdf very similar to the original docx.
I have attached 2 files : the original docx file and the PDF retrieved from a conversion with Spire.Doc. The page break is located at the end of page 5.
Is there a problem with my conversion code below, or does this come from Spire.Doc itself ?
I'm using latest version 8.5.9 but I also observed the same issue with older versions.
Thank you

Code: Select all
using (var fileStream = await file.ReadAsStreamAsync())
                {
                    var document = new Spire.Doc.Document();
                    document.LoadFromStream(fileStream, Spire.Doc.FileFormat.Docx);

                    using (var ms = new MemoryStream())
                    {
                        // Save it as PDF
                        document.SaveToStream(ms, Spire.Doc.FileFormat.PDF);

                        // Make the stream readable
                        ms.Position = 0;

                        var response = new HttpResponseMessage
                        {
                            StatusCode = HttpStatusCode.OK,
                            Content = new ByteArrayContent(ms.ToArray())
                        };

                        response.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");
                        response.Content.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment")
                        {
                            FileName = Utils.RenameFile(file.Headers.ContentDisposition.FileName, "pdf")
                        };

                        return response;
                    }
                }

softconv
 
Posts: 2
Joined: Tue Jun 02, 2020 2:03 pm

Wed Jun 03, 2020 2:45 am

Hello,

Thanks for your inquiry.
I have reproduced your issue and logged it to our bug tracking system with the ticket SPIREDOC-4572. Our Dev team will investigate further and fix it. If there is any update, we will inform you.
Apologize for the inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Wed Jun 03, 2020 12:51 pm

Ok thank you. While we wait for a fix, would you have a temporary workaround to bypass this issue ?
We are kind of blocked right now.

softconv
 
Posts: 2
Joined: Tue Jun 02, 2020 2:03 pm

Thu Jun 04, 2020 8:40 am

Hello,

Thanks for your response.
Sorry there is no temporary workaround for your issue at this time. Our Dev team will investigate it and find the solution to resolve it. And considering your situation, we have given your issue a high priority. Once it is fixed, we will notify you immediately.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Wed Jul 08, 2020 3:23 am

Hello,

Sorry for the delay and inconvenience caused.
Your issue has been resolved, here we compiled a temporary version for you, please download it and test.
http://www.e-iceblue.com/downloads/Temp ... 8.6.12.zip

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon Jul 13, 2020 10:30 am

Hello,

Hope you are doing well.
The official version of Spire.Doc is now available, please download it from the following links.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.Doc/8.7.5

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.Doc