PDF Explorer > Bug reports

Info field string length limitation

(1/4) > >>

Padanges:
Hi,
after saving a string with more than 65436 chars into a DB Metadata Info Field you can get PDFe DB to hang-up while scanning the file which the changes were made to. In such situation you won't be able to Stop the scanning (it won't respond), and PDFe will hang up. You will have to kill the process. Only entirely removing the document from the DB will help you to get PDFe to complete initial Disk scan.
I really recommend to update CommitChanges() method with string length verification and auto-truncation (perhaps with some I/O Message?). Adobe Acrobat has no problems opening this extra long "info field" string.


Regards

P.S. What are possible situations where CommitChanges() fails? Can the method return a 'fail' status? What's use of such code?:

--- Code: ---if (FileMetadata.CommitChanges()) { pdfe.echo(Filename + ' - OK');}
--- End code ---

RTT:
I'm not getting that DB problem with the long string, but yes the length must be checked and trimmed to an acceptable value.

Regarding the CommitChanges fail situation. The fail can be related to many things, like file in use, unhandled situation exception (unknown error), etc. A status code is preferable, and may be provided in a future implementation, but knowing that it failed is sufficient to be aware that a file in particular needs to be checked.

Padanges:

--- Quote ---I'm not getting that DB problem with the long string, but yes the length must be checked and trimmed to an acceptable value.
--- End quote ---
Are you suggesting we should always check that in our scripts before commiting changes?


--- Quote ---Regarding the CommitChanges fail situation. The fail can be related to many things, like file in use, unhandled situation exception (unknown error), etc. A status code is preferable, and may be provided in a future implementation, but knowing that it failed is sufficient to be aware that a file in particular needs to be checked.
--- End quote ---
Can failed file reading (or any other situation) pervent us from using "DB Only" option for saving changes with: CommitChanges(false) ? Correct me if I'm wrong but CommitChanges(false) stands for "DB only" option for changes.

Padanges:
Tooltips could also limit string length relative to the main Window size. I have had situations (messing around with LONG_PATH file names and Custom Field Info char limit) where the string would not fit into a tooltip, and the tooltip used to take whole screen width, even without showing that long string at all.
By the way, how can we get the PDFe current main window size in pixels?

RTT:

--- Quote from: Padanges on September 29, 2016, 09:13:35 AM ---
--- Quote ---I'm not getting that DB problem with the long string, but yes the length must be checked and trimmed to an acceptable value.
--- End quote ---
Are you suggesting we should always check that in our scripts before commiting changes?

--- End quote ---
And why not? But no, the trim will be done internally.


--- Quote ---Can failed file reading (or any other situation) pervent us from using "DB Only" option for saving changes with: CommitChanges(false) ? Correct me if I'm wrong but CommitChanges(false) stands for "DB only" option for changes.

--- End quote ---
No. As long a DB entry exists for the related file, the DB only metadata update will work just fine without checking for/touching the file itself.


--- Quote from: Padanges on September 30, 2016, 07:58:23 AM ---By the way, how can we get the PDFe current main window size in pixels?

--- End quote ---
I'm not aware of any ready available way to do it from a Active Scripting script, at least without the help of a third-party COM control, or a script engine with the functionality built-in (i.e. I'm sure it can be done with the ActivePython engine).

You may use this trick to get the full screen resolution.

--- Code: ---var objIE = new ActiveXObject("InternetExplorer.Application");
objIE.Visible = false;
objIE.fullscreen = true;
var width = objIE.width;
var height = objIE.height;
objIE.Quit();
pdfe.echo(width + "x" + height);

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version