Hi there,
We're having a production issue at the moment.
I'm producing PDFs via a C# asp.net website. It makes calls to another local website to generate PDFs from the URLs. The code looks like this:
public const string FileRoot = @"c:\PDFDirectory\";
void BuildPDFURL(string FileName, int TypeID, int ID) {
Prince prn = new Prince(@"C:\Program Files (x86)\Prince8.1\Engine\bin\prince.exe");
prn.SetLog("C:\\PDFDirectory\\log.txt");
prn.SetJavaScript(true);
prn.Convert("http://127.0.0.1:10300/page.aspx?id=" + ID.ToString(), FileRoot + FileName);
}
When I call Prince on a large page ~600kb if you were to download it as HTML, it blocks one CPU of our Virtual Machine - if a concurrent user generates another page, the whole machine locks up.
These PDFs can take a good while to generate, 30 seconds plus, but the issue is that this freezes our production environment.
As mentioned in the title, we have Prince8.1 (Rev5).
I've tested Prince10 Rev6 on my dev environment and it doesn't improve things (even though my CPU is WAY more powerful than the 2.2GHz Xeon processor on our VM).
Is there anyway I can improve this? Sometimes the PDFs include images served over the web, always include js / CSS, and can be added to by a user at any time - hence me producing from a dynamic page and not a document.
Any help would be greatly appreciated.
Thanks in advance,
Tom
We're having a production issue at the moment.
I'm producing PDFs via a C# asp.net website. It makes calls to another local website to generate PDFs from the URLs. The code looks like this:
public const string FileRoot = @"c:\PDFDirectory\";
void BuildPDFURL(string FileName, int TypeID, int ID) {
Prince prn = new Prince(@"C:\Program Files (x86)\Prince8.1\Engine\bin\prince.exe");
prn.SetLog("C:\\PDFDirectory\\log.txt");
prn.SetJavaScript(true);
prn.Convert("http://127.0.0.1:10300/page.aspx?id=" + ID.ToString(), FileRoot + FileName);
}
When I call Prince on a large page ~600kb if you were to download it as HTML, it blocks one CPU of our Virtual Machine - if a concurrent user generates another page, the whole machine locks up.
These PDFs can take a good while to generate, 30 seconds plus, but the issue is that this freezes our production environment.
As mentioned in the title, we have Prince8.1 (Rev5).
I've tested Prince10 Rev6 on my dev environment and it doesn't improve things (even though my CPU is WAY more powerful than the 2.2GHz Xeon processor on our VM).
Is there anyway I can improve this? Sometimes the PDFs include images served over the web, always include js / CSS, and can be added to by a user at any time - hence me producing from a dynamic page and not a document.
Any help would be greatly appreciated.
Thanks in advance,
Tom