Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack and pageBreakBefore problem #909

Closed
FabPL-62 opened this issue Mar 14, 2017 · 1 comment
Closed

stack and pageBreakBefore problem #909

FabPL-62 opened this issue Mar 14, 2017 · 1 comment

Comments

@FabPL-62
Copy link

FabPL-62 commented Mar 14, 2017

Hello, I have grouped a number of paragraphs into a single stack, behind that stack I made a table, and when the table occupies all the space on the previous page, an error occurs in the margins of some paragraphs that belong to that stack. If the stack is on the same page as the table, the error does not occur.

the stack has an id, which is used to not break it.

var docDefinition = {
   pageMargins: [20, 20, 20, 50],
   content: [
      ...,
      {
         table: {...}
      },
      {
         stack: [
             {
              columns: [
                {text: "Total honorarios", width:"*", bold:true},
                {
                  columns: [
                    {text: "$", alignment:"left", width:10, bold:true},
                    {
                      text: precio_obtener_formato($("#txt_foot_honorario").val())+".-",
                      alignment: "right",
                      width: "*",
                      bold:true
                    }
                  ],
                  width: 70
                }
              ]
            },
            ...
         ],
         margin: [20,20,20,0],
         id: "NoBreak"
      }
   ],
   pageBreakBefore: function(currentNode, followingNodesOnPage, nodesOnNextPage, previousNodesOnPage) {
        if (currentNode.id === 'NoBreak' && currentNode.pageNumbers.length != 1) {
          return true;
        }
        return false;
   },
   ...
};

I've made some image captures to see the problem
sin titulo
sin titulo2

@liborm85 liborm85 added the bug label Mar 18, 2017
@fe-cj
Copy link
Contributor

fe-cj commented Sep 23, 2024

I cannot reproduce the bug. The shared doc definition is missing content and needs some modifications to work.

Can someone share a doc definition to reproduce the issue?

It looks related to these ones: #1943 #1509 #2017 and #2298. And they were fixed in PR #2785.

But without a doc definition is not possible to tell 100%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants