Skip to main content
Tweeted twitter.com/StackSalesforce/status/1273631572848185344
added 273 characters in body
Source Link
learningmode
  • 805
  • 3
  • 23
  • 44

I am trying to do page break in LWC. But it is not working. Below is the code . How to do page break in lightning while printing the page to pdf.

<template>
   <div>First Page<<div>
      <lightning-layout>
        <lightning-layout-item>
          First Page
        </<lightning-layout-item>
      </<lightning-layout>
    </div>
    <div style="page-break-before: always;">Secondalways;">
 page<     <lightning-layout>
        <lightning-layout-item>
          Second Page
        </<lightning-layout-item>
      </<lightning-layout>
    </div>
           <lightning-button label="Print" title="print" onclick={printpreview} class="printbutton"></lightning-button>&nbsp;&nbsp;
           <lightning-button label="Back" title="Back to record" onclick={back} class="back"></lightning-button>
        </template>

I am trying to do page break in LWC. But it is not working. Below is the code . How to do page break in lightning while printing the page to pdf.

<template>
   <div>First Page</div>
   <div style="page-break-before: always;">Second page</div>
   <lightning-button label="Print" title="print" onclick={printpreview} class="printbutton"></lightning-button>&nbsp;&nbsp;
   <lightning-button label="Back" title="Back to record" onclick={back} class="back"></lightning-button>
</template>

I am trying to do page break in LWC. But it is not working. Below is the code . How to do page break in lightning while printing the page to pdf.

<template>
    <div>
      <lightning-layout>
        <lightning-layout-item>
          First Page
        </<lightning-layout-item>
      </<lightning-layout>
    </div>
    <div style="page-break-before: always;">
      <lightning-layout>
        <lightning-layout-item>
          Second Page
        </<lightning-layout-item>
      </<lightning-layout>
    </div>
           <lightning-button label="Print" title="print" onclick={printpreview} class="printbutton"></lightning-button>&nbsp;&nbsp;
           <lightning-button label="Back" title="Back to record" onclick={back} class="back"></lightning-button>
        </template>
edited tags
Link
learningmode
  • 805
  • 3
  • 23
  • 44
added 1 character in body
Source Link
learningmode
  • 805
  • 3
  • 23
  • 44

I am trying to do page break in LWC. But it is not working. Below is the code . How to do page page break in lightning while printing the page to pdf.

<template>
   <div>First Page</div>
   <div style="page-break-before: always;">Second page</div>
   <lightning-button label="Print" title="print" onclick={printpreview} class="printbutton"></lightning-button>&nbsp;&nbsp;
   <lightning-button label="Back" title="Back to record" onclick={back} class="back"></lightning-button>
</template>

I am trying to do page break in LWC. But it is not working. Below is the code . How to do page page in lightning while printing the page to pdf.

<template>
   <div>First Page</div>
   <div style="page-break-before: always;">Second page</div>
   <lightning-button label="Print" title="print" onclick={printpreview} class="printbutton"></lightning-button>&nbsp;&nbsp;
   <lightning-button label="Back" title="Back to record" onclick={back} class="back"></lightning-button>
</template>

I am trying to do page break in LWC. But it is not working. Below is the code . How to do page break in lightning while printing the page to pdf.

<template>
   <div>First Page</div>
   <div style="page-break-before: always;">Second page</div>
   <lightning-button label="Print" title="print" onclick={printpreview} class="printbutton"></lightning-button>&nbsp;&nbsp;
   <lightning-button label="Back" title="Back to record" onclick={back} class="back"></lightning-button>
</template>
deleted 2539 characters in body; edited title
Source Link
learningmode
  • 805
  • 3
  • 23
  • 44
Loading
added 173 characters in body
Source Link
learningmode
  • 805
  • 3
  • 23
  • 44
Loading
edited title
Link
David Reed
  • 93.7k
  • 14
  • 90
  • 166
Loading
edited title
Link
learningmode
  • 805
  • 3
  • 23
  • 44
Loading
Source Link
learningmode
  • 805
  • 3
  • 23
  • 44
Loading