#1 2012-03-19 22:24:58

Wolsink
Member
Registered: 2012-03-19
Posts: 9

different bitmaps are handled as the same at conversion to PDF

I am working with a derivative of the RichEdit unit which has the capability to show bitmaps in between the text.
If more than one, all different bitmaps, are present the 'ExportPDF(FileName,true,true)' function shows wrong bitmaps on certain places.
And loosing some bitmaps in the process.
The 'ShowPreviewForm' function does have the right behaviour however (there is an inconsequence between 'ExportPDF' and 'ShowPreviewForm' therefore).
I found a some what artificial work around however. By letting the dimensions (width and/or height) of the various bitmaps have small differences all works fine.

I guess that the following statement in the 'SynPdf' unit does not work as intended:
  // retrieve existing TPdfImage, or create a new if no match
  result := GetXObjectImageName(Hash,bmi^.bmiHeader.biWidth,bmi^.bmiHeader.biHeight);

A bitmap could be totally different with the same 'biWidth,bmi^.bmiHeader.biHeight' values.
I guess that 'const Hash: TPdfImageHash' should determine whether or not it's the same bitmap (with the same width and height); this seems not to work reliable however.
Bitmaps are interpreted as the same while they are not (the dimensions are the same only).

Best regards,

Gerrit Wolsink

Offline

#2 2012-03-20 05:29:16

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,253
Website

Re: different bitmaps are handled as the same at conversion to PDF

At first, you may consider disabling bitmap reuse via:

  // setting on TPdfDocumentGDI
  pdf.ForceNoBitmapReuse := True;

Then, are you sure that you used the latest version from our source code repository? See http://synopse.info/fossil/wiki?name=Get+the+source
I think this issue was already fixed by http://synopse.info/fossil/info/5d2f8fea00

Offline

#3 2012-03-20 18:12:55

Wolsink
Member
Registered: 2012-03-19
Posts: 9

Re: different bitmaps are handled as the same at conversion to PDF

Thanks for your reply.

I did use the "latest stable version"

I follow your advice to download the latest versions of 'SynPdf' and 'AQLite3Pages' from your source code repository.
I did get a compiler error however: [Error] SQLite3Pages.pas(4178): Undeclared identifier: 'WinAnsiTable'.
I gor rid of the error by brutally comment it out:
      // fast WinAnsi conversion using a fixed table from SynCommons
(*    for i := 0 to PWLen do // includes S[length(s)+1]=#0 -> last widechar #0
       PWordArray(PW)[..] := WinAnsiTable[PByteArray(s)[..]]; *)

Strange
This Forum does not allow an 'i' within square brackets to enter; I did ommit this 'i' above therefore.

Less is more? It seems to work fine now, even without the presence of 'WinAnsiTable'.
Is there a new version of SynCommons available?

I am 'playing' with meta file pictures now. Some strange things do happen.
In a separate post I will come back on it.

Offline

#4 2012-03-20 18:44:58

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,253
Website

Re: different bitmaps are handled as the same at conversion to PDF

You have to download the whole set of units.
That is, you'll need also SynCommons.pas and relatives.

Offline

#5 2012-03-20 20:46:43

Wolsink
Member
Registered: 2012-03-19
Posts: 9

Re: different bitmaps are handled as the same at conversion to PDF

I did download 'SynCommons' too, but it did not help.
Stil the same error: [Error] SQLite3Pages.pas(4178): Undeclared identifier: 'WinAnsiTable'

I did download the following version numbers:
'SynCommons' -- no. 1.16
'SQLite3Pages' -- no. 1.15
'SynPDF'-- no. 1.16
'SynGdiPlus'  -- no. 1.16

'SQLite3Pages' has still version number 1.15; is this the right one?
At the files menu this file is not present.
There is  a 'SynSQLite3' file, but that does not compile.

Offline

#6 2012-03-21 07:35:36

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,253
Website

Re: different bitmaps are handled as the same at conversion to PDF

You have to download all matching files of the same commit, in order to make them work as expected.
See http://synopse.info/fossil/wiki?name=Get+the+source process, as I stated above.

Offline

#7 2012-03-21 21:01:11

Wolsink
Member
Registered: 2012-03-19
Posts: 9

Re: different bitmaps are handled as the same at conversion to PDF

Thanks,

It was some searching to find the latest version of 'SQLite3Pages'.
It works fine with bitmaps now.
For my troubles with MetaFiles see my other post.

Gerrit Wolsink

Offline

Board footer

Powered by FluxBB