This is a migrated thread and some comments may be shown as answers.

Pdf export disable margin for first page

10 Answers 771 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chaitra
Top achievements
Rank 1
Chaitra asked on 13 Mar 2019, 03:21 PM

Hi,

As I am trying to export pdf on first page only I want to disable the margin to display icon corner page. But due to margin icon is cropping. 

How I can show complete icon on corner when margin kept as 2cm.

I have created stackblitz sample -
https://stackblitz.com/edit/angular-reexcq-48ruxl?file=app/app.component.ts

I have attached exported pdf. How I can disable margin first page or apply z-index for icon to display complete icon

 

10 Answers, 1 is accepted

Sort by
0
Hetali
Telerik team
answered on 13 Mar 2019, 08:15 PM
Hi Chaitra,

Instead of setting the margin of the Kendo PDF, set the margin of the content in a <div> tag as follows to prevent the icon from cropping:
<div class='content' style="margin-right: 50px; margin-left: 50px; margin-top: 50px;  margin-bottom: 50px">
      <my-invoice class='page-break' [data]="data"></my-invoice>
</div>
Please take a look at this runnable Stackblitz which does not crop the icon and also sets the margin

If you have any further questions about the margin attribute, reply with the details and I'll be happy to further assist you.

Regards,
Hetali
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Chaitra
Top achievements
Rank 1
answered on 14 Mar 2019, 07:04 AM

Hi Hetali,

Thanks for quick reply. I tried the same way by applying the margin for content div. But I have footer on each page which is getting overlapped with the content. How I can stop overlapping content.

https://stackblitz.com/edit/angular-reexcq-nrvahr?file=app/app.component.ts

Please see attached pdf with margin and without margin after adding footer

Thanks

 

0
Hetali
Telerik team
answered on 14 Mar 2019, 06:21 PM
Hello Chaitra,

In order to stop the content from overlapping with the footer, please set the Kendo PDF export margin as follows:

<kendo-pdf-export-margin bottom="2cm"></kendo-pdf-export-margin>

The above snippet will set a 2cm margin in the bottom of all the pages. Here's a Stackblitz example which demonstrates the approach mentioned.

I hope this helps. Please let me know if you have any further questions pertaining to Kendo PDF Export.

Regards,
Hetali
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Chaitra
Top achievements
Rank 1
answered on 14 Mar 2019, 10:04 PM
Hi Hetali,

I have tried suggested way with <kendo-pdf-export-margin bottom="2cm"></kendo-pdf-export-margin>
But I forgot to mention , I have icon on both the corner left top and right bottom like a frame so I want to disable margin on first page or apply z-index so content will come on top of margin. or some other alternative. 

Same way I applied so it is croping the image in bottom ( I have attached the local screenshot. )

But I am not able to reproduce it on stackblitz it is comming bottom image on first on top of margin. So I tried with top margin at that time it is getting crop.

https://stackblitz.com/edit/angular-reexcq-fj3ggf?file=app/app.component.ts

Same thing happening locally due to bottom margin image getting croped on local.

Can you please check it once. I tried multiple ways , even if I kept the similar code with style locally still image is getting cropped from bottom
Thanks
0
Chaitra
Top achievements
Rank 1
answered on 15 Mar 2019, 05:31 AM
Added screenshot and pdf for the above reply
0
Chaitra
Top achievements
Rank 1
answered on 15 Mar 2019, 05:50 AM

Hi Hetali,

I tried here https://stackblitz.com/edit/angular-reexcq-taeyfs?file=app/app.component.ts

But it is giving same issue. Image is getting cropped. If i tired to place content at bottom of page it is going next page and image is getting croped . How image can be always on top of margin I can set

0
Hetali
Telerik team
answered on 18 Mar 2019, 08:53 PM
Hi Chaitra,

Custom CSS is generally out of our scope of support. Although as an exception, in order to have icons in the two opposite corners of the PDF with no margin, please take a look at this StackBlitz example which uses general CSS

If you have any questions related to the Kendo PDF Export, I will be happy to assist you further.

Regards,
Hetali
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Chaitra
Top achievements
Rank 1
answered on 25 Mar 2019, 01:47 PM

Hi Hetali,

Thanks for the reply, I have checked the provided link. But with the firefox browser it is not working. I tried with firefox 66.0.1 (64-bit) version.

Need to achieve some functionality with kendo-pdf-export but not able to add due to some problem and need suggestion or a way to achieve it..

Thank you so much in advance.


0
Accepted
T. Tsonev
Telerik team
answered on 27 Mar 2019, 01:51 PM
Hi Chaitra,

The fundamental problem is that the PDF Export module does not support per-page padding settings. Please, cast your vote for this feature on our Feedback Portal so we can prioritize.

In the meantime, I've updated the sample to:
* Wrap the title page in an element with position: relative - this solves the issue in Firefox
* Use padding for the content as it will get applied on each page.

Check out the updated demo. I hope this helps.

Best Regards,
T. Tsonev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Chaitra
Top achievements
Rank 1
answered on 01 Apr 2019, 05:44 AM

Hi T. Tsonev,

Thanks for the update , I will vote for the feature on feedback portal.

 

Thanks again !!!!...

Tags
General Discussions
Asked by
Chaitra
Top achievements
Rank 1
Answers by
Hetali
Telerik team
Chaitra
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or