We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Saving a PPT as PDF containing an smartart org-chart changes the connector line's color?

When I try a save a PPT in PDF format (using SaveFormat.Pdf), the borders of the SmartArt Nodes are not displayed; and the color of connector lines between the nodes turn to default color (blue-ish).

This is how it is rendered in PPT. Look at the border of nodes and the color of connector lines:
Capture1.PNG (9.8 KB)

And this is how PDF is rendered for the same org-chart. Border is not visible, and the color of connector lines that was set to black, turns to default blue:
Capture2.PNG (42.0 KB)

What is the reason for this? Please let me know.

@tanujd_203,

I have observed the information shared by you and suggest you to please try using latest Aspose.Slides 17.8 on your end. If there is still an issue then please share the source presentation to further investigate the issue on your end.

Hi Mudassir,

I used the latest API (17.8), I’m still facing the same issue.

@tanujd_203,

I have observed your comments. Can you please share sample presentation and source code so that we may further investigate to help you out.

Below is the code through which I’m able to replicate the issue:

	Presentation pres = new Presentation();

	// Access the presentation slide
	ISlide slide = pres.getSlides().get_Item(0);
	// Add Smart Art IShape
	ISmartArt smart = slide.getShapes().addSmartArt(0, 0, 400, 400, SmartArtLayoutType.OrganizationChart);

	ISmartArtNode parentNode = smart.getAllNodes().get_Item(0);

	parentNode.getTextFrame().setText("H S Bhartia\nCCMD");
	IPortionFormat pf = parentNode.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0)
			.getPortionFormat();
	pf.getFillFormat().setFillType(FillType.Solid);
	pf.getFillFormat().getSolidFillColor().setColor(Color.black);

	while (parentNode.getChildNodes().size() > 0) {
		parentNode.getChildNodes().removeNode(0);
	}

	SmartArtNode chNode0_1 = (SmartArtNode) ((SmartArtNodeCollection) parentNode.getChildNodes())
			.addNodeByPosition(0);

	chNode0_1.getTextFrame().setText("Raju Sunil Mistry\nChief Human Resources Officer");
	pf = chNode0_1.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat();
	pf.getFillFormat().setFillType(FillType.Solid);
	pf.getFillFormat().getSolidFillColor().setColor(Color.black);

	SmartArtNode chNode1 = (SmartArtNode) ((SmartArtNodeCollection) chNode0_1.getChildNodes()).addNodeByPosition(0);
	chNode1.getTextFrame().setText("Shivshant Kumar\nGeneral Manager - HRIS");
	pf = chNode1.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat();
	pf.getFillFormat().setFillType(FillType.Solid);
	pf.getFillFormat().getSolidFillColor().setColor(Color.black);

	ISmartArtShapeCollection shapes = chNode0_1.getShapes();
	for (int i = 0; i < shapes.size(); i++) {
		ISmartArtShape sh = shapes.get_Item(i);
		if (sh.getShapeType() == -1 || sh.getShapeType() == 0 || sh.getShapeType() == 1) {
			sh.getLineFormat().getFillFormat().getSolidFillColor().setColor(java.awt.Color.WHITE);
			sh.getLineFormat().setWidth(0);
		}
	}

	ISmartArtShapeCollection shapes2 = chNode1.getShapes();
	for (int i = 0; i < shapes2.size(); i++) {
		ISmartArtShape sh = shapes2.get_Item(i);
		if (sh.getShapeType() == -1 || sh.getShapeType() == 0 || sh.getShapeType() == 1) {
			sh.getLineFormat().getFillFormat().getSolidFillColor().setColor(java.awt.Color.WHITE);
			sh.getLineFormat().setWidth(0);
		}
	}

	// Save Presentation
	pres.save("C:\\Users\\user_name\\Desktop\\ppt_to_pdf.pdf", SaveFormat.Pdf);
	pres.save("C:\\Users\\v-user_name\\Desktop\\ppt.pptx", SaveFormat.Pptx);

Observe the difference in color of connector lines in PDF and PPT.

@tanujd_203,

I have worked with the sample code shared by you and have been able to observe the issue specified. An issue with ID SLIDESJAVA-36614 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.