Footer coming not correctly in visio file

Was trying to add a footer to a visio file using Aspose Diagram Java API.

It is not showing the footer correctly. on the top i can see the footer text in a mirror image like.

The code used to add footer was

String cfilePath = “D:\test\Visio Process Flow and Decision Tree.vsdx”;

	Diagram diagram;
	try {
		diagram = new Diagram(cfilePath);
		diagram.getHeaderFooter().setFooterCenter("Center of the footer");
		diagram.save(cfilePath, SaveFileFormat.VSDX);
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

Uploading the file for which was not getting the footer text correctly.

visiofile.zip (59.3 KB)

Can you suggest?

Thanks
Sabarish

@sabkan
Thanks for the template vsdx file.
Please open the print preview of the generated vsdx file. You can see that the generated footer is centered. Please refer to the screenshot of the latest version 24.3 for the generated footer.
centerfooter.PNG (13.8 KB)

Thanks.

@philip.zhou Thanks for the quick response.

Will this work with Aspose Diagram 23.7 jar also?

Also if we convert to PDF and see the pdf document, hope we can see the footer.

Sabarish

@sabkan
Yes,It will work with Aspose Diagram 23.7 jar too.
And you will also see the footer in the pdf.
Thanks.

@philip.zhou ok,thanks for the confirmation.

Sabarish

@sabkan
Please feel free to contact us in case you have further comments or questions.

When i tried to open the visio file in pdf, the footer is still not coming correctly, i mean it shows like mirror image on top right.

footer text shown like

image.png (3.9 KB)

Attaching the output file after inserting the footer.

visioutputfle.zip (53.5 KB)

It is for the same file attached earlier in the above thread.

For other visio files also,I am getting the same behaviour. I am using trial version now of Aspose Diagram JAVA API 23.7 jar

@sabkan
I have tested your scenario/case using our latest version : Aspose.Diagram for Java v24.3 . It works fine and as expected.
Could you please share your current code that you are using. We will check and assist you accordingly.
Please refer to the following code and find attached the output pdf file for your reference.
Outfile.pdf (119.5 KB)

	// add page number at the right corner of header
   	diagram.getHeaderFooter().setHeaderRight("&p");

   	// set text at the center
   	diagram.getHeaderFooter().setHeaderCenter("Center of the header");

   	// set text at the left side
   	diagram.getHeaderFooter().setHeaderLeft("Left of the header");

   	// add text at the right corner of footer
   	diagram.getHeaderFooter().setFooterRight("Right of the footer");

   	// set text at the center
   	diagram.getHeaderFooter().setFooterCenter("Center of the footer");

   	// set text at the left side
   	diagram.getHeaderFooter().setFooterLeft("Left of the footer");

   	// set text font properties
   	diagram.getHeaderFooter().getHeaderFooterFont().setItalic(BOOL.TRUE);
   	diagram.getHeaderFooter().getHeaderFooterFont().setUnderline(BOOL.FALSE);

PS. we cannot evaluate issues with older version. Neither we can include fixes to older APIs set. The fixes are based on latest version/APIs set only.
Thanks.

This is the code being used

LocalDate today = LocalDate.now();
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(“MM/dd/yyyy”);
String formattedDate = today.format(dateTimeFormatter);

		if (!inputDir.exists()) {
			System.out.println("Input directory is not valid");
		} else {
			Diagram diagram;
			diagram = new Diagram(fileDir + File.separator + fname);
			Date date = new Date();
			diagram.getHeaderFooter().setFooterCenter(footerText + formattedDate + footerText1);

			// to have to change to VSDX,VSD,VSS formats
			diagram.save(fileDir + fname, SaveFileFormat.PDF);

Tried with 24.3 jar also and same behaviour observed as earlier.

Attaching the output file

Visio Process Flow and Decision Tree.zip (53.5 KB)

Is it related to some adobe acrobat reader setting?

@sabkan
Thanks for the screenshots.
We reproduced the problems you mentioned when using trial version.
Please set license or please set a temporary license.
We are sorry for the inconvenience.

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): DIAGRAMJAVA-51194

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.

So if we use a license will this issue be not there?

Thanks

@sabkan
Yes,Please refer to the following code and find attached the output file for your reference using license.
Please check the two files, one of which is the output file with a license set, which is normal and without a watermark.

OutFile.pdf (102.7 KB)

OutFileNoLicense.pdf (110.6 KB)
Sample code:

       LocalDate today = LocalDate.now();
       String footerText = "footerText";
       String footerText1 = "footerText1";
       DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
       String formattedDate = today.format(dateTimeFormatter);
       	Date date = new Date();
		diagram.getHeaderFooter().setFooterCenter(footerText + formattedDate + footerText1);

Thanks.

Thanks for the clarification and details.

@sabkan
You are welcome.
Feel free to contact us any time if you need further help .
Thanks.

The issues you have found earlier (filed as DIAGRAMJAVA-51194) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou

@philip.zhou
Verified the fix in aspose-diagram-24.4.jar and it is working fine as expected.

Thanks

@sabkan
It is great that you were able to resolve this issue on your end. In case you have further inquiries or may need any help in future, please let us know by posting a new thread in Aspose.Diagram’ forum.
Thanks.