COM Interface 2.4.0 : How to overwrite a file?


#1

HI,
Is there a way to overwrite the file after the conversion with ConvertTo(path) ?
The new version doesn’t overwrite the file as the previous one.

The only setting i found in the documentation is for a FTP server :
Ftp.EnsureUniqueFilenames Bool : If true, files with the same name will not be overwritten on the server. A counter will be appended instead (i.e. document_2.pdf).

Is there another COM property setting for a local file ( for example “PdfSettings.EnsureUniqueFilenames” ) ?

Thank you for your answer,
Best regards,

Lionel


#2

Hi all,

Can you comfirm me if it is possible or not with the COM Interface 2.4.0 to overwrite a file with the same name ?

Thank you for your help,

Lionel


#3

Hi,

it seems it is possible to do it, but not to change the setting via COM.
The COM interface will use the setting of the profile used for the conversion, e.g. if you change this setting once (profile settings->auto-save->ensure unique filenames) through the GUI and save it, the files will get overwritten afterwards.

Best regards,

Robin


#4

Hi Robin,

Thanks for your answer.

That work good through the GUI but we have to enable the auto saving and set a defaulft folder (V2.4.0).
As I use a script using the COM Interface 2.4.0 in a VBA application used by many people in my compagny , that means I have to set up all users GUI and be sure that they don’t modify this configuration !
Do you know if in a future release it will be possible to change the overwriting through the COM interface ? (like for the FTP server property : Ftp.EnsureUniqueFilenames Bool

Thank you again for your support and all the job done with PDFCreator,

Lionel


#5

Hi Lionel,

I think it would be only consequent to make this setting available through COM, it was most likely overlooked because it is a sub-setting of the auto-save section and the auto-save setting (enabled or disabled) itself isn’t needed when working through COM. Until it has been implemented, you could in theory set this directly in the users registry so that you can do it from the script (HKEY_CURRENT_USER\SOFTWARE\pdfforge\PDFCreator\Settings\ConversionProfiles\0\AutoSave “Ensure unique filenames”).

Best regards,

Robin


#6

Hi Robin,

You are right : my script is now working fine when i set the users registry as per your recommandation.

Thank your for your guidance. It is really appreciated,

Lionel


#7

Hi Robin.
If GUI it has an option to do this, so, it will be a very useful property in COM object, too.
To modify system registry is not so clearly programmatically, while Windows 7 or greater disable this option for a user, we have to run script modification with admin rights.
So, I will wait for that property directly in COM object!
Thanks :slight_smile:


#8

Hi,

a ticket for this has been created but I can’t promise it will make it to the next update which will be released shortly.

Best regards,

Robin


#9

Did anything ever happen with this? My workaround is to delete the file first using kill if it already exists.