PDF creation time varies drastically depending on page setup

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v6)  /  PDF creation time varies drastically depending on page setup

DynamicPDF CoreSuite for .NET (v6) Forum

Hi,

We are using ceTe.DynamicPDF.35
(Product Version 6.0.4.35,Build 19502) to create pdf document. we have observed following case for pdf generation:

Case 1: if we set below page setup pdf generation takes 2-3 seconds
1) Page Size : A4
2) Page Orientation : Landscape
3) Margin (L,T,R,B) : 54.14, 72.0, 54.14, 72.0

Case 2: if we set below page setup pdf generation takes 2-3 minutes
1) Page Size : A4
2) Page Orientation : Landscape
3) Margin (L,T,R,B): 70.87, 70.87, 70.87, 70.87

Both the time same code is getting executed only difference is in margin.

we are using following code segment:

_pageDimensions = new PageDimensions(H,W);
_pageDimensions.TopMargin = Above Float Value;
_pageDimensions.BottomMargin = Above Float Value;
_pageDimensions.LeftMargin = Above Float Value _pageDimensions.RightMargin = Above Float Value

We have tried using SetMargins(L,T,R,B) method also but same thing happens.

We are using .NetFramwork 4.0 and Visual Studio 2010.
Why this is happening? is margin affects GetVisibleHeight() or GetOverflowRows(x, y) execution??
Posted by a ceTe Software moderator
Hello,

We have not seen this kind of behavior while using our DynamicPDF product API. Please try using the latest version 6.x DynamicPDF dll file in your application and see if it works for you. You can download the latest DynamicPDF dll file by logging into our CustomerArea using your version 6 DynamicPDF product serial number. Remove reference for the old dll file and reference the latest dll file in your application.

If you continue getting the similar behavior even after using the latest DynamicPDF dll file then please send over the following details to our support team so that they can look into it further.

1.        Sample code or project which uses static data using which the behavior can be recreated.
2.        Input PDF documents if you are using any for merging.
3.        Exact build number of the DynamicPDF dll file which you are using in your application.

Thanks,
ceTe Software Support Team.
Hello,

I have observed "GetVisibleHeight()" is taking long time.

 do
 {

  float visibleHeight = pdfTable.GetVisibleHeight();
  Bool fitOnSamePage = !((visibleHeight + y) > _pageContentHeight);

  // rest of code goes here

    pdfTable = pdfTable.GetOverflowRows(x, y);

 } while (pdfTable != null);

The first line of code which assigns visible height takes long time. if i comment out "pdfTable.GetVisibleHeight()" and assign it a static value e.g. "float visibleHeight = 350;" it creates pdf in seconds.

Why pdfTable.GetVisibleHeight() method takes long time?? can you suggest anything??

Thanks,
Naitik
Posted by a ceTe Software moderator
Hello Naitik,

We did some testing on our end and we are not able to recreate the behavior which you mentioned about different execution time by setting different margins.

The GetVisibleHeight method of the Table2 class does not depend on the page margins and it calculates the height depending on the number of rows present and row height in Table2 object.

Please send over sample code or sample project which uses static data to our support team using which they can recreate the behavior. This information will help them to look into it further.

Thanks,
ceTe Software Support Team.
Hello,

Ok. I will prepare demo application and send it to support team.

Only one question : PageDimensions class has one method SetMargins() which takes float data type.

My question is : what type of dimensions it expects?
e.g Inch, Millimeter, centimeter or some other.

because i have value in Millimeter so do i need to convert it or pass it as it is??

Thanks,
Naitik
Posted by a ceTe Software moderator
Hello Naitik,

DynamicPDF Generator and Merger for .NET API use a coordinate system based on points. You will need to convert the values in millimeter to points and use this converted value to set it as margins. Please refer documentation on coordinate system here.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 8:21 AM.