이 작업을 수행하려는 사람은이 코드를 사용하여 종료했습니다. 이렇게하면 많은 수의 페이지를 가져 와서 PDF로 변환하고 단일 zip 파일로 압축 할 수 있습니다.
Dictionary<string, byte[]> pdfByteList = new Dictionary<string, byte[]>();
string pageName = "TestPage";
string htmlToConvert = GetHTML(pageName); //Perform the Server.Execute() code here and return the HTML
PdfConverter converter = new PdfConverter();
byte[] pdfBytes = converter.GetPdfBytesFromHtmlString(htmlToConvert);
pdfByteList.Add(pageName, pdfBytes);
using (ZipFile zip = new ZipFile())
{
int i = 0;
foreach(KeyValuePair<string,byte[]> kvp in pdfByteList)
{
zip.AddEntry(kvp.Key, kvp.Value);
i++;
}
Response.Clear();
Response.BufferOutput = true; // false = stream immediately
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "attachment; filename=TheZipFile.zip");
zip.Save(Response.OutputStream);
}