Slow pdf generation

I have a test case where pdf generation takes much time. Here is a sample project:
TestAppCore.zip (375.0 KB)

Steps to reproduce:

  1. Open project in Visual Studio
  2. In the solution there are two svg files: hangs.svg and img.svg. By default the img.svg is used in the test project
  3. Ruch the app and choose a destination folder
  4. Press the button. The code is creating pdf file with this svg image inside. On my machine this operation took approximately 40 sec.
  5. You can also use hangs.svg file and the result is simillar.

Btw. hangs.svg file is created by Aspose.Imaging library

Thanks

@ManMasterDevelopment
For convert Svg to Pdf the better use following code :

var loadopt = new SvgLoadOptions();
using(var doc = new Document(filename, loadopt))
{
      doc.Save(destFile);
}

image.png (18.4 KB)

Thanks for the answer. Your suggestion seems to work. But I have another issue with Footer. Here is a sample project:
TestAppCore.zip (397.2 KB)

Steps to reproduce are the same. This new sample project adds header and footer to the pdf page. And the result is that adding header works but footer is missing.

@ManMasterDevelopment
This happens because page.PageInfo.Margin.Bottom == 0
use

page.PageInfo.Margin = new(0, 15, 0, 0);

in AddPage method

@sergei.shibanov your solution partially works but not always. The problem is that size of the bottom margin depends on the footer text size. So if in the current version of my test app size 15 is good (on my machine I had to set 25) then when you change a footer text to be as twice long as the previous value, in this case, footer again will be invisible.
In my application, users can set any text they want as a footer so I’m not able to determine how big the bottom margin should be. Is there a way that aspose lib will calculate this value internally?

@ManMasterDevelopment
I looked and it actually disappears when the line length increases. It may be implemented so that if the line does not fit, then it is not displayed - but this is not entirely good. It is also unclear with the definition of the height required for the footer.
I tried to define it by setting the cells’ IsWordWrapped to true and taking Table.Height() after setting the values, but that doesn’t seem to work. Maybe the developers did not take into account the case for landscape page orientation. I will create a task to the development team.

@ManMasterDevelopment
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-55970

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.