Pdf export overflow not aligned

Posted by: justin.arias on 5 August 2021, 4:35 pm EST

    • Post Options:
    • Link

    Posted 5 August 2021, 4:35 pm EST

    I’m seeing an issue when performing a spread save pdf, with the following printInfo settings causes an issue with overflow cells. Any cells at the end of our page with overflow applied causes the text to overflow onto the next page and cover the header. Please see pdf attached for example.

    This doesn’t happen on spread designer so I tried to compare the printInfo but I’m not sure how to retrieve the printInfo from the spread designer. This is our printInfo:

    _bestFitColumns: false

    _bestFitRows: false

    _blackAndWhite: false

    _centering: 0

    _columnEnd: -1

    _columnStart: -1

    _firstPageNumber: 1

    _fitPagesTall: -1

    _fitPagesWide: -1

    _footerCenter: “&P/&N”

    _footerCenterImage: “”

    _footerLeft: “”

    _footerLeftImage: “”

    _footerRight: “”

    _footerRightImage: “”

    _headerCenter: “”

    _headerCenterImage: “”

    _headerLeft: “Excellentable”

    _headerLeftImage: “”

    _headerRight: “Sheet1”

    _headerRightImage: “”

    _margin: {bottom: 75, footer: 30, header: 30, left: 70, right: 70}

    _orientation: 1

    _pageOrder: 0

    _pageRange: “”

    _paperSize: a {g3: 9, Vo: 826.7716535433073, _v: 1169.2913385826773}

    _qualityFactor: 2

    _repeatColumnEnd: -1

    _repeatColumnStart: -1

    _repeatRowEnd: -1

    _repeatRowStart: -1

    _rowEnd: -1

    _rowStart: -1

    _showBorder: true

    _showColumnHeader: 2

    _showGridLine: true

    _showRowHeader: 2

    _useMax: true

    _watermark:

    _zoomFactor: 1

    Not sure if these settings are causing the issue or maybe the spread settings. Any help is appreciated

  • Posted 5 August 2021, 4:36 pm EST

  • Posted 6 August 2021, 8:05 am EST

    Hi Justin,

    This is expected behavior when the content of the cell does not fit to the page it will be displayed on the next page. For this, You may use the fitPagesWide as 1. Please refer to the following code snippet and attached sample that demonstrates the same.

    printInfo.fitPagesWide(1);
    

    sample: https://codesandbox.io/s/spread-js-starter-forked-khp42?file=/src/index.js:1957-1987

    Regards

    Avinash

  • Posted 6 August 2021, 9:59 am EST

    Thank you I will try it on my local. By the way the sandbox provide doesn’t work for me as the $ and GC objects have not been imported into index.js

  • Posted 6 August 2021, 11:55 am EST

    Also this doesn’t have quite the same effect as spreadjs designerhttps://www.grapecity.com/spreadjs/designer/index.html I’m attaching spreadjs pdf export and the new export with the printInfo options you’ve provided.

    The original PDF export I’ve attached has the issue where the overflow covers the headers. In the spreadjs designer export doesn’t have that issue.Excellentable - 2021-08-06T114137.009.zipspreadjsexample.zip

  • Posted 6 August 2021, 11:56 am EST

    This is the pdf with the PrintInfo you’ve providedExcellentable - 2021-08-06T114137.009.zip

  • Posted 9 August 2021, 2:08 am EST - Updated 3 October 2022, 9:37 am EST

    Hi Justin,

    If I understand correctly the issue is the long content is getting exported on another page. For this, as suggested above you could use the fitPagesWide method which fits the columns inside a single page.

    Further regarding the ColumnHeader getting overlapped with text issue:

    We are sorry but we are unable to replicate the issue at our end. Could you please share the sample file(ssjson or output of spread.toJSON()) that you are trying to export as pdf so that we could investigate it further and assist you accordingly.

    You may also refer to the following sample and gif of our observation and let us know if we missed any steps.

    sample: https://codesandbox.io/s/spread-js-starter-forked-qi67j?file=/src/index.js

    Regards

    Avinash

  • Posted 24 September 2021, 5:18 pm EST - Updated 3 October 2022, 9:37 am EST

    Sorry I was pulled into other projects. I have tried your approaches but the text still overlaps the row header.Here is an image and a zip containing the json

    overflow test (1).zip

  • Posted 24 September 2021, 5:21 pm EST

    In addition to the above comment, setting the fitPagesWide or bestFitColumns squeezes the columns together and text is no longer readable. I am able to export fine using spreadjs designer or your sandbox without having to set those properties

  • Posted 27 September 2021, 7:26 am EST

    Hi Justin,

    From the sample, it seems like you are using Spread.net in MVC but We are unable to run the project that you provided also we weren’t able to find any related JSON file. Could you please share a working sample that replicates the issue so that we could investigate it further and assist you accordingly?

    Regards

    Avinash

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels