linkedinfacebooktwittermenuarrow-up

GemBox Support Forum

Gembox not respecting locked fields

Hi!

We have a wordfile with a DOCPROPERTY called CurrentVersion, we use this file to record our released versions and what changed. For example:

EXAMPLE SOFTWARE 3.0 (where 3.0 is the current value of CurrentVersion)
blabla
EXAMPLE SOFTWARE 2.0 (where 2.0 is a locked CurrentVersion)
blabla
EXAMPLE SOFTWARE 1.0 (where 1.0 is a locked CurrentVersion)
blabla

In our build process gembox converts this to a pdf through the document.Save-method, but despite versions 2 and 1 being locked it updates them to the current value, this is the output we get in the pdf:

EXAMPLE SOFTWARE 3.0
blabla
EXAMPLE SOFTWARE 3.0
blabla
EXAMPLE SOFTWARE 3.0
blabla

How can we disable field updates when saving to pdf if it’s possible?

Thanks!

Hi Jamey,

Please try again with this bugfix:
https://www.gemboxsoftware.com/document/nightlybuilds/GBD35v1178.zip

Or this NuGet package:
Install-Package GemBox.Document -Version 35.0.1178-hotfix

Does this solve your issue?

Regards,
Mario

1 Like

Thanks for the quick fix Mario, this seems to work if I loop over all the fields from C# and set (field.IsLocked = true;).

However if I inspect fields that I know are locked in word they all show IsLocked as false, is it possible for Gembox to recognize they were already locked in the document itself?

Otherwise this fix is great, when can we expect an official release?

Hi,

Can you please send us your Word file that has locked fields?
I’ll need to investigate why this issue occurs, why the Field.IsLocked was not read for your file.

Regards,
Mario

Hi, I’m unable to send the file, however I just tried with a docx and it worked as expected but files that are doc-extension don’t work if I don’t manually set IsLocked as described above. Is it possible to create a fix for those as well? We still have a lot of those.

Hi,

Please try again with this bugfix:
https://www.gemboxsoftware.com/document/nightlybuilds/GBD35v1183.zip

Or this NuGet package:
Install-Package GemBox.Document -Version 35.0.1183-hotfix

Does this solve your issue?

Regards,
Mario

Hi Mario, thanks again. Sadly it doesn’t work, but I’ve created an example file:
here

Hi,

Please try again with this bugfix:
https://www.gemboxsoftware.com/document/nightlybuilds/GBD35v1186.zip

Or this NuGet package:
Install-Package GemBox.Document -Version 35.0.1186-hotfix

Does this solve your issue?

Regards,
Mario

1 Like

Thanks Mario! Now it works :slight_smile:

Good job!