We have a problem, when we try to convert a pptx to pdf with PdfCompliance PdfA1b.
The DisplayDocTitle is not set in the output pdf.
As I understand this entry in the forum, it is currently not possible and necessary to set DisplayDocTitle directly in pptx:
But when we try to convert our pptx to a PDF with a certain PdfComliance, the title is not set correctly.
I created a test for this and tested it also in LinqPad:
using System.IO;
using Aspose.Pdf;
void Main()
{
var test = new RegressionTest.PDF.DocumentPropertiesTests();
test.PptxToPdfCheckDisplayDocTitle(Aspose.Slides.Export.PdfCompliance.PdfA1a);
test.PptxToPdfCheckDisplayDocTitle(Aspose.Slides.Export.PdfCompliance.PdfA1b);
test.PptxToPdfCheckDisplayDocTitle(Aspose.Slides.Export.PdfCompliance.PdfUa);
}
namespace RegressionTest.PDF
{
[TestClass]
public class DocumentPropertiesTests
{
private const string pptxFileName = @"C:\\temp\\PptxToPdfA1bDisplayDocTitleBug\\CultureChartsPptxTest.pptx";
[DataTestMethod]
[DataRow(Aspose.Slides.Export.PdfCompliance.PdfA1a)]
[DataRow(Aspose.Slides.Export.PdfCompliance.PdfA1b)]
[DataRow(Aspose.Slides.Export.PdfCompliance.PdfUa)]
public void PptxToPdfCheckDisplayDocTitle(Aspose.Slides.Export.PdfCompliance pdfCompliance)
{
const string pptxToPdfFileName = "TransformedCultureChartsPptxTest.pdf";
var presentation = new Aspose.Slides.Presentation(pptxFileName);
presentation.DocumentProperties.Title = "Simple Chart";
var saveOptions = new Aspose.Slides.Export.PdfOptions()
{
SaveMetafilesAsPng = false,
Compliance = pdfCompliance
};
using (var pdfStream = new MemoryStream())
{
presentation.Save(pdfStream, Aspose.Slides.Export.SaveFormat.Pdf, saveOptions);
pdfStream.Seek(0, SeekOrigin.Begin);
using (FileStream fileStream = new FileStream(pptxToPdfFileName, FileMode.Create, FileAccess.Write))
{
pdfStream.WriteTo(fileStream);
}
}
var pdfDocument = new Document(pptxToPdfFileName);
System.Console.WriteLine("PdfCompliance {0} - DisplayDocTitle {1}", pdfCompliance.ToString(), pdfDocument.DisplayDocTitle);
}
}
}
The output is:
image.png (2,7 KB)
The used pptx file is:
CultureChartsPptxTest.zip (45,9 KB)
Is this a bug in Aspose.Slides or do you know a solution to this problem?
We tried it out with Aspose.Slides 24.12.0 and 22.2.0.
Thank you for your help