Synopse Open Source - Tag - PNG - CommentsmORMot MVC / SOA / ORM and friends2024-02-02T17:08:25+00:00urn:md5:cc547126eb580a9adbec2349d7c65274DotclearGIF, TIF, PNG and JPG pictures TGraphic read/write via GDI+ - A.Bouchezurn:md5:fa56b4dac9a10b79df5aebaa2042487e2010-09-23T16:10:21+02:002010-09-23T15:10:21+02:00A.Bouchez<p>Antialiased drawing from TMetaFile has been added to this unit.<br />
Therefore, you can draw using a regular TCanvas, then use GDI+ to render it
with proper anti-aliasing.</p>
<p>See <a href="http://blog.synopse.info/post/2010/04/02/Antialiased-drawing-from-TMetaFile" rel="ugc nofollow">this
post for further details</a>.</p>Synopse PDF engine - A.Bouchezurn:md5:706fa7dfef3a92f4f8c637ba089f81962010-06-21T11:21:18+02:002010-06-21T10:21:18+02:00A.BouchezPlease discuss about the <i>Synopse PDF Library</i> in <a href="http://synopse.info/forum/viewforum.php?id=1" rel="ugc nofollow">our dedicated forum</a>.Synopse PDF engine - A.Bouchezurn:md5:774b710d8ed3c42dab8e4129fe44224a2010-05-06T16:42:11+02:002010-05-06T15:42:11+02:00A.Bouchez<p>The unit has been updated, and now support Glyph Shaping. Arabic sample
included.</p>
<p>See this article about <a href="https://blog.synopse.info?post/post/2010/05/06/Synopse-PDF-engine-1.7.2" rel="ugc nofollow">the update to version
1.7.2</a>.</p>Synopse PDF engine - A.Bouchezurn:md5:225038ccff9c5ff9922874a3df4ec6d02010-05-06T07:28:53+02:002010-05-06T06:28:53+02:00A.Bouchez<p>To Dirk: I don't have the Acrobat application. Too much money for me: that's
why I wrote this library <img src="https://blog.synopse.info?pf=wink.svg" alt=";)" class="smiley" /><br />
I've added the /Type key, as you suggested. Thanks for the feedback!</p>
<p>To Mohammed: Thanks for the "Glyph Shaping" reference. I'll use the
ScriptGetProperties API to get the work done. I'll then need your feedback
about the result!</p>
<p>I'll send a new article on this blog when I'm ready with the updated
version.</p>
<p>In all cases, thanks for your feedback and very helpful comments. That's the
beauty of OpenSource: sharing, sharing, sharing... <img src="https://blog.synopse.info?pf=smile.svg" alt=":)" class="smiley" /></p>Synopse PDF engine - d.carstensenurn:md5:0326076585d72aa11a9c88ec3e1f6faa2010-05-05T15:55:01+02:002010-05-05T14:55:01+02:00d.carstensen<p>Hi,<br />
quite amazing, especially creating font subsets is well done!</p>
<p>One hint: Unicode.pdf is damaged because the /Type key is missing in
Descendant font (/Type is required).<br />
I test my PDFs with Acrobat full-version: When Acrobat ask for saving (without
modification) the PDF is damaged and was repaired by Acrobat.<br />
Another good syntax validation tool is the Acrobat-Preflight tool.<br />
One profile can detect file format errors.</p>
<p>Best regards<br />
Dirk Carstensen</p>Synopse PDF engine - Mohammed Nasmanurn:md5:bf19cfd9ebc4bf748c53eac86d1d5cba2010-05-05T13:48:23+02:002010-05-05T12:48:23+02:00Mohammed Nasman<p>A,<br />
Arnaud,</p>
<p>I think what do you need to support Arabic to check the if the language
require "Glyph Shaping" which is needed for Arabic language, because the
character change it's shape depend on his position on the word, you can check
that using ScriptGetProperties as the following<br />
<a href="http://msdn.microsoft.com/en-us/library/dd317788(v=VS.85" title="http://msdn.microsoft.com/en-us/library/dd317788(v=VS.85" rel="ugc nofollow">http://msdn.microsoft.com/en-us/lib...</a>).aspx</p>
<p>I posted a question on SO, to help translate the example to Delphi, because
I'm not good in C++.</p>
<p>You can read more here:<br />
<a href="http://www.xmlpdf.com/rtl.html" title="http://www.xmlpdf.com/rtl.html" rel="ugc nofollow">http://www.xmlpdf.com/rtl.html</a></p>Synopse PDF engine - A.Bouchezurn:md5:465a954960af0c0ce83c2fc050dd469b2010-05-05T09:18:22+02:002010-05-05T08:18:22+02:00A.Bouchez<p>Reading text from pdf is not a difficult task. Since I could need such a
feature for another project (http://roc-armees.info), I think I'll implement
extracting text from a PDF file in a future version of SynPDF. This unit
already knows the PDF structure, it will be not a big challenge to make the
TPDFDocument class read a PDF content.</p>Synopse PDF engine - Luiz Américourn:md5:5db747b4b75326cf1fd04b7eda497d2d2010-05-04T18:32:58+02:002010-05-04T17:32:58+02:00Luiz Américo<p>Thanks again. It's working now.</p>Synopse PDF engine - A.Bouchezurn:md5:5368621f1813ce5b376bf5273787ec642010-05-04T11:22:39+02:002010-05-04T10:22:39+02:00A.Bouchez<p>The Unicode works well... You just forgot to use BeginText/EndText and
MoveTextPoint/SetLeading methods as required by the PDF format.</p>
<p>I've release your example code, with the corrections, to be downloaded at
<a href="http://synopse.info/files/pdf/synpdfunicode.zip" title="http://synopse.info/files/pdf/synpdfunicode.zip" rel="ugc nofollow">http://synopse.info/files/pdf/synpd...</a><br />
I've added the resulting testunicode.pdf file.</p>
<p>The resulting PDF is OK for Greek, but there is some problems with Right to
Left languages:<br />
- I had to reverse the chars manually, which is not the best option here (see
parenthesis problems);<br />
- Arabic Ligatures are not handled by the Acrobat Reader: they should be
handled by the PDF producer. I think there are some low level Windows API for
that, but I don't know them. Can anyone help about this?</p>
<p>Note that the TrueType subset font embedding works with these characters,
without any problem. I've also modified the TPdfDocument constructor, in order
to allow another codepage for the PDFString, if needed.</p>Synopse PDF engine - Luiz Américourn:md5:7d8dec0eaab0b811075d6a84ed6fb60b2010-05-04T03:51:03+02:002010-05-04T02:51:03+02:00Luiz Américo<p>Hi,</p>
<p>I tried without success creating a pdf with unicode. I sent to your email a
Delphi 7 example.</p>Synopse PDF engine - A.Bouchezurn:md5:0b29ba4886d4721e4ff0e8d88921c1602010-05-03T19:06:29+02:002010-05-03T20:24:46+02:00A.Bouchez<p>The engine is 100% unicode ready.</p>
<p>The PDFString is an AnsiString using the current code page. It is used
internaly for most Ansi-Encoded values (like property names in PDF), and can be
used safely from Delphi 7 to 2010.<br />
See TPdfDocument.Create constructor code and CodePage/FCodePage variable in the
unit. Override existing SysLocale.DefaultLCID value before calling this
constructor.</p>
<p>Another possibility is to use Wide version of the API calls, together with
the VCLCanvas property.</p>
<p>You could even use direct Unicode text output using:<br />
- under Delphi 2009/2010, the TPdfCanvas.ShowText(const text: UnicodeString;
NextLine: boolean) method<br />
- with all versions of Delphi: the TPdfCanvas.ShowText(PW: PWideChar; NextLine:
boolean=false) method<br />
- with all versions of Delphi: the TPdfCanvas.TextOutW() method<br />
- by using a PDFString and changing the current code page encoding</p>
<p>Both ShowText() methods (Unicode or Ansi) can be mixed, but must be embraced
by BeginText/EndText methods:<br />
with P.Canvas do begin<br />
SetFont('georgia',12,[fsItalic,fsBold]);<br />
SetLeading(Page.FontSize); // next line just below the current one<br />
BeginText;<br />
MoveTextPoint(20,P.DefaultPageHeight-40);<br />
ShowText('Testé chez nous');<br />
ShowText(pointer(WideChars),True);<br />
EndText;<br />
end;</p>
<p>I didn't test or implement RTL languages. Perhaps you could help me with
your knowledge of both Delphi and Arabic!</p>Synopse PDF engine - A.Bouchezurn:md5:1276b6326c4d7e5c7d7e2c30142399f22010-05-03T19:04:35+02:002010-05-03T18:04:35+02:00A.Bouchez<p>I downloaded Acrobat Reader 9.</p>
<p>In fact, Acrobat Reader 9 doesn't handle the /flags item of the font
definition as expected by the PDF Reference 1.3 official document §5.7.1... it
expect this item to be equals to 32 (i.e. PDF_FONT_STD_CHARSET) whatever the
font type is. Talk about standard and specifications!</p>
<p>Fixed with the newly uploaded version of the library.<br />
Thanks for your feedback!</p>Synopse PDF engine - Luiz Américourn:md5:aac6e10f5a34a0804bf37ef5fac029c92010-05-03T18:47:31+02:002010-05-03T17:47:31+02:00Luiz Américo<p>Opening both files (testdirect and testvcl) with adobe reader 9 gives an
error about invalid font Georgia,BoldItalic.</p>
<p>Also i noticed that you are using WinAnsiEncoding (i.e., code page 1252).
Some unicode characters can not be represented by such code page and in this
case is necessary to use UTF16-LE encoding.</p>
<p>This library handle all unicode range?</p>Synopse PDF engine - Mohammed Nasmanurn:md5:de1d98be03e779bf4161d466480356f02010-05-03T17:40:05+02:002010-05-03T16:40:05+02:00Mohammed Nasman<p>Nice work,<br />
But when I try to compile the first example, I got this error:<br />
[DCC Error] SynCommons.pas(1247): E2441 Inline function declared in interface
section must not use local symbol 'WinAnsiTableSortedFind'</p>
<p>It worked, after I remove the inline from the WideCharToWinAnsi method.</p>
<p>Also it seems not working with RTL languages like Arabic, or is there an
option to set the code page to 1256?</p>