Merger and CPU Usage

Merger and CPU Usage

Forum member · Apr 5, 2007
Hello, (yes, its me again!) I have a program that is creating a directory that merges together multiple existing PDFS and one that is generated using the Generator product. It is possible for this document to be upwards of 700+ pages. This will be run from my corporate website. When I attempt to create the large PDF (700+ pages) it takes up about 50% of my CPU (the aspnet_wp.exe process itself). Has anyone run into this issue? Anyone know how to spawn a helper thread or something else using code or within IIS for this type of large operation using the ceTe products? Thanks, Matt L.

Re: Merger and CPU Usage

Support · Apr 6, 2007
Hello Matt, We are working on putting up an example that would spawn a helper thread when generating large files using our product. We will post the sample code once we have it ready but it may take few days. Thanks, ceTe Software Support Team

Re: Merger and CPU Usage

Support · Apr 6, 2007
Hello Matt, We have sample console application that will spawn a new thread and cause the main thread to sleep. public class Simple { public static void Main(String[] args) { FileStream myStream = new FileStream(@"C:\Temp\Test.pdf",FileMode.Create); HelloWorld hello = new HelloWorld(myStream); Thread thread = new Thread( new ThreadStart(hello.GeneratePDF)); thread.Priority = ThreadPriority.Lowest; thread.Start(); thread.Join(); } class HelloWorld { private Stream stream; public HelloWorld(Stream stream) { this.stream = stream; } public void GeneratePDF() { ceTe.DynamicPDF.Document document = new ceTe.DynamicPDF.Document(); ceTe.DynamicPDF.Page page = new ceTe.DynamicPDF.Page( PageSize.Letter, PageOrientation.Portrait, 54.0f ); Label label = new Label( "Hello World", 0, 0, 504, 100, Font.Helvetica, 18, TextAlign.Center ); for(int i=0; i<500;i++) { page.Elements.Add( label ); document.Pages.Add( page ); } document.Draw( stream ); } } } Thanks, ceTe Software Support Team

Re: Merger and CPU Usage

Forum member · Apr 6, 2007
Thank you for the reply! I will see if I can implement this in the short time I have. ~ Matt