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

Free Support Forum - aspose.com

Preserving original date and time footers/headers when converting to PDF (setUpdateDateTimeFields)

Hello,


I have a question regarding the method Presentation.setUpdateDateTimeFields(false) which was removed in Aspose.Slides 16.2.0.

We use this method in our application in order to preserve the original date when exporting a document to PDF. It’s very important for us to show the original date, not the date when the document was converted to PDF.

Now we are at 16.1.0 and we can not upgrade to a newer version because of that feature removed.

Is there any work around how we can do that in the new version? Or is there any chance you can get this option back?

Thanks.

Hi Igor,


I have observed the requirements shared and regret to share that Aspose.Slides does not support preserving date and time original. I have created an issue with ID SLIDESJAVA-35724 as new feature request to investigate the possibility of implementing the requested feature support. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

Best Regards,

Hello,


Any news on the issue?

I can see that you have a similar article how to preserve the fields for MS Word documents (http://www.aspose.com/docs/display/wordsjava/How+to++Replace+Fields+with+Static+Text)

If you can not bring the removed functions back, can you please provide a work-around similar to the one for MS Word documents?

Hi Igor,

I have verified from our issue tracking system and regret to share that at present the issue is blocked owing to missing implementation in Aspose.Slides for .NET. I have requested our product team to share further details in this regard and will share that with you as soon as they will be shared.

Many Thanks,

Hello,


Thanks Mudassir!

Do you have any updates regarding when this issue will be fixed?

At the moment we still have to use the old version 16.1.0 where it worked and can not upgrade until it’s fixed.

Alternatively, can you please provide a work-around how can I achieve the similar effect using the existing functionality? Like this one: http://www.aspose.com/docs/display/wordsjava/How+to++Replace+Fields+with+Static+Text

Hi Igor,


I have observed your comments and regret to share that at present the issue is still unresolved. Actually, the issue is blocked owing to missing implementation in other issue of Aspose.Slides for .NET. So, it is going to get resolved in .NET issue first and then in this issue. The issue involves complex implementation and I have also requested our product team to share further feedback regarding the issue. I request for your patience till the time further feedback is shared by our product team and issue gets resolved.

We are sorry for your inconvenience,

Hello,


> I have also requested our product team to share further feedback regarding the issue.

Have you got any update on when it might be fixed?

Thanks.

Hi Igor,

I have verified from our issue tracking system and regret to share that at present the issue is still unresolved owing to missing implementation in Aspose.Slides for .NET. However, I have raised the priority of the issue to High so that our product team may consider this new feature request with revised priority. I will also share further updates with you as soon as they will be shared by our product team.

We are sorry for your inconvenience,

Hello,

I’ve just got a notification that the issue SLIDESJAVA-35724 has been fixed in the last version (17.6):

The issues you have found earlier (filed as SLIDESJAVA-35724) have been fixed in this update.
SLIDESJAVA-35724 - Preserving original date and time - Investigation

However I could not find the following method in the new version:

Presentation.setUpdateDateTimeFields(false)

Can you please help to understand how to use the new functionality?

Thanks.

@igor.rogov,

I suggest you to please try using following sample code on your end to serve the purpose. Please share, if I may help you further in this regard.

IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo("pres.pptx");
IDocumentProperties props = info.readDocumentProperties();
Date currentLastSavedTime = props.getLastSavedTime();

// Please note that exactly THIS string will be used in resulting PDF document 
// in date time field. It can be formated differently in source presentation, 
// depending on portion.getField().getType().getInternalString() "datetime" value. If you need to 
// format this date according to this rules, use this field value.
DateFormat df = DateFormat.getDateInstance();
String currentLastSavedTimeString = df.format(currentLastSavedTime);

Presentation pres = new Presentation("pres.pptx");
try
{
	IPresentationHeaderFooterManager presentationHeaderFooter = pres.getHeaderFooterManager();
	presentationHeaderFooter.setAllDateTimesText(currentLastSavedTimeString);

	pres.save("pres.pdf", SaveFormat.Pdf);
} finally {
	if (pres != null) pres.dispose();
}

Many Thanks,

Mudassir Fayyaz

Hi Mudassir,

Thanks for sharing this information! I think it will work, though ideally I would like to have the old method back, so it would just print the original text stored in the presentation.

Just one more question. How can I find the right date format that was used in the original document? I can see it in the code comment, it’s not clear how to get this “portion” object:

It can be formated differently in source presentation,
depending on portion.getField().getType().getInternalString() “datetime” value. If you need to
format this date according to this rules, use this field value.

And how can I format the date using the original document’s date format like “datetime8”? Is there any function that can do that?

Thanks.

@igor.rogov,

I have observed your requirements and have added an issue with ID SLIDESJAVA-36471 as enhancement to investigate the shared requirements. This thread has been linked with the issue so that you may be automatically notified once the feedback will be shared by our product team.

Many Thanks,

Mudassir Fayyaz

The above code just updates the date time in header and footer but how do i do the same thing for notes and content in the slide.

@pradeepdone,

I have observed your requirements and have not been able to completely understand them. Can you please share the requirement in the form of sample presentation and snapshot so that I may investigate that on my end to help you out.