How to wrap images in aspose.pdf when converting html to pdf for .NET

@nethmi

We got it now.

Please provide the above requested information so that we can further proceed accordingly.

1 Like

Please check now.

Are you checking it or need more information???

@nethmi

We tested the case in our environment and noticed that the PDF generated by Aspose.PDF looks similar to the HTML that was obtained after editing CSS using Html Agility Pack. Please check the attached output PDF document and supplied HTML (generated after running AddFroalaCSSSupport() method): htmltopdf.zip (647.9 KB)

Hii

sorry. My issue is occurring when I am going to convert pdf document in to pptx. In our case, first of all we are creating the pdf and then we are converting that pdf in to pptx. My issue is occurring in the pptx document. see my code below.

    htmlLoadOptions.PageInfo.Margin.Left = 50;
    htmlLoadOptions.PageInfo.Margin.Right = 50;
    htmlLoadOptions.PageInfo.Margin.Top = 50;
    htmlLoadOptions.PageInfo.Margin.Bottom = 50;
    htmlLoadOptions.PageInfo.Width = Aspose.Pdf.PageSize.A4.Width;
    htmlLoadOptions.PageInfo.Height = Aspose.Pdf.PageSize.A4.Height;
    htmlLoadOptions.PageInfo.Width = 959.976;
    htmlLoadOptions.PageInfo.Height = 540;
                                                                                                                                         
        //convert html to pdf
        htmlDocument.Save(htmlOutputStream);
        htmlOutputStream.Seek(0, System.IO.SeekOrigin.Begin);
        Document pdfDocument = new Document(htmlOutputStream, htmlLoadOptions);
                                
        //convert pdf to pptx
        PptxSaveOptions pptx_save = new PptxSaveOptions();
       
        using (var pptxStream = new MemoryStream())
        {
            pdfDocument.Save(pptxStream, pptx_save);
            pptxStream.Seek(0, System.IO.SeekOrigin.Begin);
            pdfBytearray.Add(pptxStream.ToArray());
        }

Please run my whole method (with my css) and get the pptx output. I used page height and width to get the pptx doc. Run it with my height value and width value which I used to get the pptx. you can see my problem in there.

htmlLoadOptions.PageInfo.Width = 959.976;
htmlLoadOptions.PageInfo.Height = 540;

I think that issue is happening because of the height and width. Not only because of the height and width but also it’s happening when I reduce content between the wrapped images. do you have any solution for that??

check this new HTML NewHTML.zip (1.9 KB)
conerted PPTX MyPPTX.zip (77.5 KB)

expected expectedOutcome.PNG.jpg (304.6 KB)
current outcome CurrentOutput.PNG.jpg (242.2 KB)

@nethmi

We are checking it and will get back to you shortly.

1 Like

Hiii

any update??

@nethmi

We were able to reproduce the issue in our environment. Therefore, have logged it as PDFNET-51972 in our issue tracking system. We will further look into its details and let you know as soon as it is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.

1 Like