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، وإجراء خطأ التحويل كمعلمات. يمكن استخدام معلمة الدفق لحفظ سجل التحويل. تحدد معلمة إجراء خطأ التحويل ما يجب القيام به إذا حدثت أي أخطاء أثناء التحويل. في هذه الحالة، تم تعيينها إلى “حذف”، مما يعني أنه سيتم حذف أي عناصر غير متوافقة مع تنسيق PDF/A-3B من المستند.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.