ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 The time in the metadata of the saved pdf file.

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Stalker4 Posted - Feb 17 2021 : 03:38:08
Hi All,

Delphi 10.4.1, Win32, ImageEn 9.0.0.

There is a code that saves scanned document pages from a stream to a pdf file.
with ListImageEnMView.MIO do
   for nCou := 0 to ListImageEnMView.ImageCount-1 do begin
     Params[nCou].PDF_Compression := ioPDF_JPEG;
     Params[nCou].PDF_Creator := 'Cancelar3';
   end;

 ListImageEnMView.MIO.SaveToStreamPDF(FStream);

While executing this code, I look at the current time in my OS "Windows 7" (eg time 15:30). The Windows clock is showing the correct time.

But when I look at the properties (metadata) of the saved pdf file (in Adobe Reader, in FireFox or any other program that can view the pdf file metadata), then in the "Created" column there is a time of 17:30, that is, for two hours more.
As I understand it, this is somehow related to the time zone on the user's computer.

Is it possible to fix this (creation time) somehow, so that the correct time would be in the metadata of the pdf file?
12   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jun 15 2021 : 00:05:54
Thanks for the report. We'll have a fix in 10.0.2.

Nigel
Xequte Software
www.imageen.com
Stalker4 Posted - Jun 14 2021 : 03:49:26
You again broke work with "TimeZone" in Imageen 10.x .x.

Programs that know how to work with "TimeZone" (for example, Firefox 89 or Adobe Reader DC) are shown for 1 hour more, programs that do not know how to work with "TimeZone" (for example Adobe Reader X) are shown correctly.

Here you have a great code that works correctly with "TimeZone" in all cases

function GetTimeZoneDeltaStr(separator: string = ':'): string;
var
  TzInfo: TTimeZoneInformation;
  delta: integer;

begin

  delta := 0;

  case GetTimeZoneInformation(TzInfo) of
    TIME_ZONE_ID_UNKNOWN: delta := TzInfo.Bias;
    TIME_ZONE_ID_STANDARD: delta := TzInfo.Bias + TzInfo.StandardBias;
    TIME_ZONE_ID_DAYLIGHT: delta := TzInfo.Bias + TzInfo.DayLightBias;
  end;

  if delta <= 0 then
    Result := '+'
  else
    Result := '-';
  delta := abs(delta);
  if separator = '''' then
    Result := Result + Format('%.2d', [delta div 60]) + '''' + Format('%.2d', [delta mod 60]) + ''''
  else
    Result := Result + Format('%.2d', [delta div 60]) + ':' + Format('%.2d', [delta mod 60]);

end;

procedure TIEPDFBuilder.SetInfoTags(
begin
...

  info.items.AddObject('CreationDate', TIEPDFStringObject.Create( AnsiString( dateStr + GetTimeZoneDeltaStr('''') )));
  info.items.AddObject('ModDate', TIEPDFStringObject.Create( AnsiString( dateStr + GetTimeZoneDeltaStr('''') )));

end;

Stalker4 Posted - Feb 25 2021 : 01:32:42
Yes, now the time is displayed correctly in all cases.

Do not forget to fill in the "Modified" (ModDate) tag, otherwise you have it empty.
xequte Posted - Feb 24 2021 : 19:02:42
Here's an update that should fix it, but it is difficult to test properly (having to fake my time zone):

www.imageen.com/temp/PdfBuilderDemo2.zip

Nigel
Xequte Software
www.imageen.com
Stalker4 Posted - Feb 24 2021 : 01:34:11
There is not quite the right correction.

Some programs can correctly show time taking into account the time zone (for example Adobe Reader DC, Firefox 85), and some are not (for example Adobe Reader X).

Applying your patch, I created a new Test .pdf file,
Creation time 08:23.
Also, I have a Word.pdf file created in Word (I tried Word 2010, Word 2016), creating time 10:56.

I open Test .pdf in Firefox 85 or Adobe Reader DC - the creation time in the metadata 08:23, i.e. Right.
I open Test .pdf in Adobe Reader X - the creation time in the metadata 06:23, i.e. 2 hours less. And it is expected, because Adobe Reader X does not know how to work with time zones, and the time in the PDF metadata is given by UTC.

And now we take Word.pdf and open it in Firefox 85 or Adobe Reader DC - creation time in metadata 10:56, i.e. Right.
Open Word.pdf in Adobe Reader X - creation time in metadata 10:56, i.e. Also right.

And the following conclusion is obtained: PDF created in Imageen, its creation time is properly shown only in programs that can work with time zones (under the correct I mean, it corresponds to the real time for creating this file). And it is not correctly shown in programs that do not know how to work with time zones.

At the same time, the PDF file created in Word, its creation time is correctly shown in both situations.

Fix it.

In the archive 2 PDF file

Word.pdf is created in Word 2010.
His real time of creation 10:56.
This time is shown correctly in Adobe Reader DC, Firefox 85, Adobe Reader X.

Word.pdf is created in Word 2016.
Its real time creation 08:43.
This time is shown correctly in Adobe Reader DC, Firefox 85, Adobe Reader X.

That is, their time in the "column is created" is shown correctly for both programs that can work with a time zone and for programs that do not know.

At the same time, fill the Count "Changed", and then it is empty.

attach/Stalker4/202122413538_test.zip
253.96 KB
xequte Posted - Feb 23 2021 : 15:51:41
Hi

Please download it from:

www.imageen.com/temp/PdfBuilderDemo.zip

Nigel
Xequte Software
www.imageen.com
Stalker4 Posted - Feb 21 2021 : 14:21:17
Then I'll wait until March.
Could you make a small demo (.exe) with this corrected code, which would save its data in pdf ? It's just that there are certain nuances (when formed by time) and I would like to check them.
xequte Posted - Feb 21 2021 : 13:56:36
Hi

Unfortunately the fix is source only until the release of v9.3.2. It will probably be released in March.

Nigel
Xequte Software
www.imageen.com
Stalker4 Posted - Feb 21 2021 : 04:46:48
I have a trial version of ImageEn 9.0.0, which I downloaded from your site last year. Now I decided to try it and found this problem. If these errors are fixed in newer versions of ImageEn, please tell me which one ?
xequte Posted - Feb 18 2021 : 14:16:54
Hi

We have a fix for this. If you email me I will send it to you.

Nigel
Xequte Software
www.imageen.com
Stalker4 Posted - Feb 18 2021 : 02:11:29
I apologize, I did not understand your question ...
xequte Posted - Feb 17 2021 : 15:14:26
Hi

Please email me for an update that fixes this.

Nigel
Xequte Software
www.imageen.com