GetAttachment
محتويات
[
يخفي
]GetAttachment(string)
تخزين المرفقات في ملف .
public void GetAttachment(string outputPath)
معامل | يكتب | وصف |
---|---|---|
outputPath | String | مسار الدليل حيث سيتم تخزين المرفقات . تعني السلسلة الفارغة أو الفارغة أن المرفق (المرفقات) سيتم وضعه في دليل التطبيق. |
أنظر أيضا
- class PdfExtractor
- مساحة الاسم Aspose.Pdf.Facades
- المجسم Aspose.PDF
GetAttachment()
يحفظ كل ملفات المرفقات في streams.
public MemoryStream[] GetAttachment()
قيمة الإرجاع
مصفوفة دفق الملف المرفق في مستند pdf.
أمثلة
[C#]
PdfExtractor extractor = new PdfExtractor();
extractor.BindPdf(path + "Attach.pdf");
extractor.ExtractAttachment();
IList names = extractor.GetAttachNames();
MemoryStream[] tempStreams = extractor.GetAttachment();
for (int i=0; i<tempStreams.Length; i++)
{
string name = (string)names[i];
FileStream fs = new FileStream(path + name,System.IO.FileMode.Create);
byte[] tempBytes = new byte[4096];
tempStreams[i].Position = 0;
for (; ; )
{
int numOfBytes = tempStreams[i].Read(tempBytes, 0, 4096);
if (numOfBytes < 1)
break;
fs.Write(tempBytes, 0, numOfBytes);
}
fs.Close();
}
[Visual Basic]
Dim extractor As PdfExtractor = New PdfExtractor()
extractor.BindPdf(path + "Attach.pdf")
extractor.ExtractAttachment()
extractor.GetAttachment(path)
Dim names As IList = extractor.GetAttachNames()
Dim tempStreams() As MemoryStream = extractor.GetAttachment()
for(Integer i = 0 i<tempStreams.Length i++)
{
Dim name As String = CType(names(i), String)
Dim fs As FileStream = New FileStream(path + name,System.IO.FileMode.Create)
Dim tempBytes() As Byte = New Byte(4096) {}
tempStreams(i).Position = 0
for()
{
Dim numOfBytes As Integer = tempStreams(i).Read(tempBytes,0,4096)
If numOfBytes < 1 Then
break
End If
fs.Write(tempBytes, 0, numOfBytes)
}
fs.Close()
}
أنظر أيضا
- class PdfExtractor
- مساحة الاسم Aspose.Pdf.Facades
- المجسم Aspose.PDF