Hi,
Hi there,
Hi there,
Hi,
Hi there,
Hi,
We have further investigated the issue reported earlier and as per our current estimates, we plan to get this problem fixed in Aspose.Pdf for .NET 10.0.0 which is planned to release in January-2015. However its not a promise but we will try our level best to get this problem fixed by said time.
Glad to hear this!
Hi,
Thanks for your patience.
In order to accomplish your requirement, please try using the following code snippet with the upcoming release of Aspose.Pdf for .NET 10.0.0.
[C#]
Document doc = new Document();
doc.Pages.Add();
// Create a file specification object
FileSpecification fs = new FileSpecification("data.jpg");
// Add that file to the embedded files collection of.pdf
doc.EmbeddedFiles.Add(fs);
fs.Params = new FileParams(fs);
fs.Params.CreationDate = new DateTime(2011, 11, 11, 11, 11, 11);
fs.Params.ModDate = new DateTime(2012, 12, 12, 12, 12, 12);
// Save the result file
doc.Save("37374.pdf");
The issues you have found earlier (filed as PDFNEWNET-37374) have been fixed in Aspose.Pdf for .NET 10.0.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi,
I’m facing this problem in Aspose.PDF 11.7 . I’ve tried adding an attachment different ways, but I’m consistently getting the message “ModDate value is empty”.
Could you confirm this ?
The example on https://docs.aspose.com/pdf/net/attachments/ doesn’t seem to work.
My latest try:
Aspose.Pdf.FileSpecification fileSpec = new Aspose.Pdf.FileSpecification(attFilename, att.Name);
pdfdoc.EmbeddedFiles.Add(fileSpec);
fileSpec.Params = new Aspose.Pdf.FileParams(fileSpec);
fileSpec.Params.ModDate = DateTime.Now;
fileSpec.Params.CreationDate = DateTime.Now;
pdfdoc.Save(pdfstream); // ← Exception “ModDate value is empty”
UPDATE: it seems that the main pdf needs ModDate. This is only needed when having attached a file. without attachments, ModDate is not needed.
edwins:
Hi,
I’m facing this problem in Aspose.PDF 11.7. I’ve tried adding an attachment different ways, but I’m consistently getting the message “ModDate value is empty”.
Could you confirm this ?
The example on http://www.aspose.com/docs/display/pdfnet/Add+Attachment+to+PDF doesn’t seem to work.My latest try:
Aspose.Pdf.FileSpecification fileSpec = new Aspose.Pdf.FileSpecification(attFilename, att.Name); pdfdoc.EmbeddedFiles.Add(fileSpec); fileSpec.Params = new Aspose.Pdf.FileParams(fileSpec); fileSpec.Params.ModDate = DateTime.Now; fileSpec.Params.CreationDate = DateTime.Now; pdfdoc.Save(pdfstream); // <-- Exception "ModDate value is empty"UPDATE: it seems that the main pdf needs ModDate. This is only needed when having attached a file. without attachments, ModDate is not needed.
Hi Edwin,
Thanks for contacting support.
I have tested the scenario using latest release of Aspose.Pdf for .NET 11.7.0 with the following code snippet and I am unable to notice any issue. As per my observations, the problem may be related to input PDF or the file which you are trying to add as an attachment to PDF document. Can you please share your resource files, so that we can again test the scenario in our environment. We are sorry for this inconvenience.
Example
// Instantiate Document instance
Document pdfdoc = new Document();
pdfdoc.Pages.Add();
Aspose.Pdf.FileSpecification fileSpec = new Aspose.Pdf.FileSpecification("c:/pdftest/Ppt-resize-test.pdf");
pdfdoc.EmbeddedFiles.Add(fileSpec);
fileSpec.Params = new Aspose.Pdf.FileParams(fileSpec);
fileSpec.Params.ModDate = DateTime.Now;
fileSpec.Params.CreationDate = DateTime.Now;
pdfdoc.Save("c:/pdftest/ResultantWith_Attachment.pdf");
Hi Nayyer,
Did you receive my testcase ?
Regards,
Edwin
Hi Edwin,
Hi Edwin,
@edwins
Please to attach a file directly to the PDF document to enable accurate reproduction of the script.
Please note that there is a possibility that the requirement specified in the PDF specification has been violated (see attached image).
2.png (102.4 KB)
10 years later …
@edwins
The developers have finally started reviewing all the remaining tasks, starting with the old ones.