0
일부 입력 데이터에서 pdf를 생성하려고합니다. 그래서 난 내 PdfGenerator()를 생성하고 몇 가지 텍스트로 PDF 생성이 내 HttpPost 메서드에서 호출되는Aspose.pdf가 백 페이지를 반환합니다.
public class PdfGenerator {
public PdfGenerator() {
//Instantiate License class and call its SetLicense method to use the license
var license = new Aspose.Pdf.License();
license.SetLicense("Aspose.Total.lic");
}
public void Generate(Generation input) {
//Create pdf document
var pdf1 = new Pdf();
//Add a section into the pdf document
var sec1 = pdf1.Sections.Add();
//Add a text paragraph into the section
sec1.Paragraphs.Add(new Text("Hello World"));
//Save the document
pdf1.Save(input.Reference + ".pdf", SaveType.OpenInBrowser, HttpContext.Current.Response);
}
}
을 :
// POST api/values
[System.Web.Http.HttpPost]
public void Post([FromBody]Generation value) {
_pdfGenerator.Generate(value);
}
하지만 난 단지, 어떤 흰색 페이지 된 PDF를 얻을 수 내가 왜 잘못하고 있는거야?