Hi,
I would like to check how to i convert doc, xls, ppt, html and pdf to pdf/a?
do i have to do it step by step?
for example,
convert doc into pdf 1st
after convert to pdf/a?
if so what function should i use?
Hi,
Just an update.
Hi,
Hi Benjamin,
Hi Tilal,
Validating file “output.pdf” for conformance level pdfa-1b |
xmp:CreateDate :: Wrong value type. Expected type ‘Date’. |
xmp:ModifyDate :: Wrong value type. Expected type ‘Date’. |
dc:creator :: Wrong value type. Expected type ‘seq’. |
dc:title :: Wrong value type. Expected type ‘lang alt’. |
dc:description :: Wrong value type. Expected type ‘lang alt’. |
The required XMP property ‘pdfaid:part’ is missing. |
The required XMP property ‘pdfaid:conformance’ is missing. |
The XMP property ‘xmp:CreatorTool’ is not synchronized with the document information entry ‘Creator’. |
The XMP property ‘xmp:CreateDate’ is not synchronized with the document information entry ‘CreationDate’. |
The XMP property ‘xmp:ModifyDate’ is not synchronized with the document information entry ‘ModDate’. |
The XMP property ‘pdf:Producer’ is not synchronized with the document information entry ‘Producer’. |
The value of the key N is 4 but must be 3. |
The value of the key SMask is an image but must be None. (2) |
The document does not conform to the requested standard. |
The document doesn’t conform to the PDF reference (missing required entries, wrong value types, etc.). |
The document contains transparency. |
The document’s meta data is either missing or inconsistent or corrupt. |
Done. Code snippet used: |
Hi,
further more i tested using the following old code for conversion of pptx to pdf/a
bczm8703:Hi Tilal,Thanks for replying. i have tried the 2 step way for ppt. now there is the following error
Validating file "output.pdf" for conformance level pdfa-1b xmp:CreateDate :: Wrong value type. Expected type 'Date'. xmp:ModifyDate :: Wrong value type. Expected type 'Date'. dc:creator :: Wrong value type. Expected type 'seq'. dc:title :: Wrong value type. Expected type 'lang alt'. dc:description :: Wrong value type. Expected type 'lang alt'. The required XMP property 'pdfaid:part' is missing. The required XMP property 'pdfaid:conformance' is missing. The XMP property 'xmp:CreatorTool' is not synchronized with the document information entry 'Creator'. The XMP property 'xmp:CreateDate' is not synchronized with the document information entry 'CreationDate'. The XMP property 'xmp:ModifyDate' is not synchronized with the document information entry 'ModDate'. The XMP property 'pdf:Producer' is not synchronized with the document information entry 'Producer'. The value of the key N is 4 but must be 3. The value of the key SMask is an image but must be None. (2) The document does not conform to the requested standard. The document doesn't conform to the PDF reference (missing required entries, wrong value types, etc.). The document contains transparency. The document's meta data is either missing or inconsistent or corrupt. Done.
Code snippet used:
//Instantiate a Presentation object that represents a presentation filePresentation pres = new Presentation(DATA_DIR + "sample.pptx");Aspose.Slides.Export.PdfOptions opts = new Aspose.Slides.Export.PdfOptions();opts.EmbedFullFonts = true; opts.EmbedTrueTypeFontsForASCII = true;opts.TextCompression = Aspose.Slides.Export.PdfTextCompression.None;//Save the presentation to PDF with default optionspres.Save(DATA_DIR + "ConvertedNewPPT.pdf", Aspose.Slides.Export.SaveFormat.Pdf, opts);Aspose.Pdf.Document pptDocument = new Aspose.Pdf.Document(DATA_DIR + "ConvertedNewPPT.pdf");pptDocument.Convert(DATA_DIR + "logPPPT.xml", PdfFormat.PDF_A_1B,ConvertErrorAction.Delete);pptDocument.OptimizeResources(new Aspose.Pdf.Document.OptimizationOptions() {RemoveUnusedObjects = true,RemoveUnusedStreams = true,AllowReusePageContent = true,CompressImages = true});// Save output documentpptDocument.Save(DATA_DIR + "output.pdf");And when i tried to open the supposely converted pdf output.pdf, my Adobe Reader detect it as normal pdf.i have attached the xml file which is the log file for this conversion
bczm8703:And there is an option during ppt conversion to pdf to set compliance to pdf/a. Would suggest your development team to try fix the issue so that conversion from ppt/pptx to pdf/a would be simpler and cleaner
hi. another question.
Hi Benjamin,
Thanks for your inquriy. I am afraid there is no option available to convert PDF to PDFA without a log file. However if you do not want to keep the log file then you can delete it as following. Hopefully it will help you to accomplish the task.
...
documentpdf.Convert(myDir + "log.xml", PdfFormat.PDF_A_1B,
ConvertErrorAction.Delete);
if (File.Exists(myDir + "log.xml"))
{
File.Delete(myDir + "log.xml");
}
...
Please feel free to contact us for any further assistance.
Best Regards,
bczm8703:And there is an option during ppt conversion to pdf to set compliance to pdf/a. Would suggest your development team to try fix the issue so that conversion from ppt/pptx to pdf/a would be simpler and cleaner
Hi Benjamin,
Adding more to Tilal’s comments, you may consider using Stream object to save conversion log and then close the Steam instance.
[C#]
// load existing PDF file
Document pdfDocument = new Document("c:/pdftest/source.pdf");
pdfDocument.Convert(new MemoryStream(), PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
pdfDocument.Save("c:/ pdftest / Resultant.pdf");