I am converting some PDF to PPTX and applying a custom background to each slide after conversion. On one PDF the content is covering the background completely. I’ve shared the sample code and PDF that reproduces the problem.
var theme = new Presentation("src/main/java/" + themeName + ".pptx");
try (Document document = new Document("src/main/java/" + fileName + ".pdf")) {
var secondPage = document.getPages().get_Item(2);
var width = secondPage.getRect().getWidth();
var height = secondPage.getRect().getHeight();
// Set size of first page
document.getPages().get_Item(1).setPageSize(width, height);
document.save(fileName + ".pptx", SaveFormat.Pptx);
var presentation = new Presentation(fileName + ".pptx");
presentation.getSlideSize().setOrientation(SlideOrientation.Landscape);
var sourceSlide = theme.getSlides().get_Item(0);
IMasterSlide sourceMaster = sourceSlide.getLayoutSlide().getMasterSlide();
var slideMaster = presentation.getMasters().addClone(sourceMaster);
for (var slide : presentation.getSlides()) {
slide.getLayoutSlide().setMasterSlide(slideMaster);
if (sourceSlide.getShowMasterShapes())
slide.setShowMasterShapes(sourceSlide.getShowMasterShapes());
}
for (var slide : presentation.getSlides()) {
slide.getSlideShowTransition().setType(TransitionType.Fade);
}
presentation.save(fileName + ".pptx", com.aspose.slides.SaveFormat.Pptx);
}
@srijal,
As far as I can see, the background is applied correctly for every slide in the presentation, but a shape on the second slide completely covers the background. output.png (200.4 KB)
Could you please describe the problem?
Thanks for taking a look. Yeah, there is a shape covering the slide and hiding the background. But I think this shouldn’t be there. The second page is correctly converted without any page-spanning shape. Is the problem in the conversion or is the image on the PDF not correctly made?
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): SLIDESJAVA-39124
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Please also share the following additional information:
OS version on which code was executed
JDK version in your app
You have shared the output presentation file. Could you please share the initial PDF file?
We have converted your PDF into PPTX while using 23.3 version of the API. Can you please open the attached PPTX file and share screenshot of the issue that you are noticing? This would help us in investigating the issue accordingly. CC.zip (132.8 KB)