Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
다음 코드 스니펫은 Aspose.PDF.Drawing 라이브러리와 함께 작동합니다.
ZUGFeRD를 PDF에 첨부하기 위해 다음 단계를 권장합니다:
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void AttachZUGFeRD()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf_DocumentConversion();
// Open PDF document
using (var document = new Aspose.Pdf.Document(dataDir + "ZUGFeRD-testInput.pdf"))
{
// Setup new file to be added as attachment
var description = "Invoice metadata conforming to ZUGFeRD standard";
var fileSpecification = new Aspose.Pdf.FileSpecification(dataDir + "ZUGFeRD-testXmlInput.xml", description)
{
Description = "Zugferd",
MIMEType = "text/xml",
Name = "factur-x.xml"
};
// Add attachment to document's attachment collection
document.EmbeddedFiles.Add(fileSpecification);
document.Convert(new MemoryStream(), Aspose.Pdf.PdfFormat.ZUGFeRD, Aspose.Pdf.ConvertErrorAction.Delete);
// Save PDF document
document.Save(dataDir + "AttachZUGFeRD_out.pdf");
}
}
변환 메서드는 스트림, PDF 형식 및 변환 오류 작업을 매개변수로 사용합니다. 스트림 매개변수는 변환 로그를 저장하는 데 사용할 수 있습니다. 변환 오류 작업 매개변수는 변환 중 오류가 발생할 경우 수행할 작업을 지정합니다. 이 경우 “Delete"로 설정되어 있으며, 이는 PDF/A-3B 형식에 부합하지 않는 모든 요소가 문서에서 삭제됨을 의미합니다.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.