PDF related issue

2 Answers 11 Views
Drawing API
Aniket
Top achievements
Rank 1
Iron
Aniket asked on 08 Feb 2022, 02:54 AM

Attached  two files for your reference.

Code snippet is as below :- 

$scope.MonthlyExportStatement = function() {
        $scope.MonthlyDownloadButton = "Downloading...";
        kendo.drawing.drawDOM(".monthly-pdf-page", {
            paperSize: "A3",
            margin: "1cm",
            multiPage: true,
        }).then(function(group){
            kendo.drawing.pdf.saveAs(group, "test.pdf");
            setTimeout(function(){
                $scope.MonthlyDownloadButton = "Download PDF";
                $scope.$apply();
            });
        });
}

For actual image please refer image 2. While downloading PDF with kendoUI, Image is getting cut off.  What was wrong with above code ? Please assist me ASAP.

2 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 09 Feb 2022, 11:22 AM

Hello Aniket,

The Drawing library has some limitations regarding exporting images. I would suggest you review the related section in the Limitations article linked below and check if the images are not missing from the exported file due to a limitation:

https://docs.telerik.com/kendo-ui/framework/drawing/limitations-browser-support#images

I would also suggest you check for the errors in the browser console as there could be a CORS-related error in case the server does not provide permissive Cross-Origin HTTP headers.

Looking forward to your reply.

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Aniket
Top achievements
Rank 1
Iron
answered on 09 Feb 2022, 04:11 PM
Already handled cross origin HTTP headers with my angularJs code.

Can you please provide sample code for  KeepTogether options in DOM drawing library ? I have applied the same for Image title and  Image but it is not working as expected.  I want Image title and Image is on the one page.  Image is not fit into paper then that image goes into another page. I don't want image title and image on separate page. Please help me in the same.
Neli
Telerik team
commented on 10 Feb 2022, 08:24 AM

Hi Aniket,

I prepared a Dojo example using the keepTogether option. Here you will find linked Dojo. In the example, there is an image included. As you will see, the image is never exported on multiple pages. Also, the text and the image wrapped in the 'custom' class are exported on the same page.

Could you please provide more details regarding the content that you are trying to export on your side? It will be nice if you could modify the Dojo example in order to use content that replicates the behavior the way it is on your side and send it back for a review so we could take a closer look.

Looking forward to your reply.

Tags
Drawing API
Asked by
Aniket
Top achievements
Rank 1
Iron
Answers by
Neli
Telerik team
Aniket
Top achievements
Rank 1
Iron
Share this question
or