You are not logged in.
Pages: 1
I can't see your photo, and the site is unavailable. Can you describe it in words?
It's just the result of executing your code.
I can't help you specifically, but I think only the fonts shown below apply the style properly.
// SynPdf.pas
const // see PDF ref 9.6.2.2: Standard Type 1 Fonts
...
STANDARDFONTS: array[0..11] of record
Name: PDFString;
Widths: PSmallIntArray;
end = (
(Name: 'Times-Roman'; Widths: @TIMES_ROMAN_W_ARRAY),
(Name: 'Times-Bold'; Widths: @TIMES_BOLD_W_ARRAY),
(Name: 'Times-Italic'; Widths: @TIMES_ITALIC_W_ARRAY),
(Name: 'Times-BoldItalic'; Widths: @TIMES_BOLDITALIC_W_ARRAY),
(Name: 'Helvetica'; Widths: @ARIAL_W_ARRAY),
(Name: 'Helvetica-Bold'; Widths: @ARIAL_BOLD_W_ARRAY),
(Name: 'Helvetica-Oblique'; Widths: @ARIAL_ITALIC_W_ARRAY),
(Name: 'Helvetica-BoldOblique'; Widths: @ARIAL_BOLDITALIC_W_ARRAY),
(Name: 'Courier'; Widths: nil), // Widths:nil -> set all widths to 600
(Name: 'Courier-Bold'; Widths: nil),
(Name: 'Courier-Oblique'; Widths: nil),
(Name: 'Courier-BoldOblique'; Widths: nil));
...
const
STAND_FONTS_PDF: array[TPdfFontStandard] of RawUTF8 = ('Times','Helvetica','Courier');
STAND_FONTS_WIN: array[TPdfFontStandard] of RawUTF8 = ('Times New Roman','Arial','Courier New');
Related to
Chinese Font bold style does not work, when EmbeddedTTF is true (Page 1) / PDF Engine / mORMot Open Source
https://synopse.info/forum/viewtopic.ph … 270#p34270
(D7, mORMot 1.18.6222)
--
https://paste.ee/p/12VCO
--
--
--
--
--
XE3:
var
lPdf: TPdfDocumentGDI;
begin
lPdf := TPdfDocumentGDI.Create;
try
//lPdf.UseUniscribe := True;
lPdf.ScreenLogPixels := 96;
lPdf.DefaultPaperSize := psA4;
lPDF.AddPage;
lPdf.VCLCanvas.Brush.Style := bsClear;
lPdf.VCLCanvas.Font.Name := 'SimSun'; // 宋体
lPdf.VCLCanvas.TextOut( 20, 20, '发现双引号不正确“问题”' );
lPdf.SaveToFile('%TEMP%\SynPdfTest.pdf');
finally
lPdf.Free;
end;
end;
D7:
var
lStr: WideString;
lLen: integer;
lPdf: TPdfDocumentGDI;
begin
lStr := TntEdit1.Text; // Tnt Delphi Unicode Controls
lLen := Length('TextOutW: ' + lStr);
lPdf := TPdfDocumentGDI.Create;
try
//lPdf.UseUniscribe := True;
lPdf.ScreenLogPixels := 96;
lPdf.DefaultPaperSize := psA4;
lPDF.AddPage;
lPdf.VCLCanvas.Brush.Style := bsClear;
lPdf.VCLCanvas.Font.Name := 'SimSun'; // 宋体
lPdf.VCLCanvas.TextOut( 20, 20, 'TextOutA: ' + lStr );
TextOutW( lPdf.VCLCanvas.Handle, 20, 40, PWideChar('TextOutW: ' + lStr), lLen );
lPdf.SaveToFile( '%TEMP%\SynPdfTest.pdf' );
finally
lPdf.Free;
end;
end;
if IdemPChar(pointer(Ctxt.URL),'abc') then
.....
but always return false?
same response on windows both linux .
function IdemPChar(p: PUTF8Char; up: PAnsiChar): boolean;
// if the beginning of p^ is same as up^ (ignore case - up^ must be already Upper)
var
lStr: string;
begin
lStr := 'ABC';
ShowMessage( BoolToStr( IdemPChar(Pointer(lStr), 'abc' ), True ) );
// False
ShowMessage( BoolToStr( IdemPChar(Pointer(lStr), 'ABC' ), True ) );
// True
ShowMessage( BoolToStr( IdemPChar(Pointer(lStr), 'Abc' ), True ) );
// False
ShowMessage( BoolToStr( IdemPChar(Pointer(lStr), PAnsiChar(UpperCase('Abc')) ), True ) );
// True
end;
Hi all,
Can anybody help me with this?
How do I persist a TDocVariant object to a file?
Let's say I have this code:aTemplate:variant;
TDocVariant.New(aTemplate);
aTemplate.Subject := 'some Subject';
aTemplate.Description := 'some Description';// Persist aTemplate to file ...something like SaveToFile(someFileName);
Any help in the right direction much appreciated.
Cheers,
Wai
procedure TForm1.Button1Click(Sender: TObject);
var
aTemplate: Variant;
begin
TDocVariant.New(aTemplate);
aTemplate.Subject := 'some Subject';
aTemplate.Description := 'some Description';
Memo1.Lines.Add( aTemplate );
// {"Subject":"some Subject","Description":"some Description"}
Memo1.Lines.Add( aTemplate.Subject );
// some Subject
Memo1.Lines.Add( aTemplate.Description );
// some Description
FileFromString( aTemplate, 'test.txt' );
// {"Subject":"some Subject","Description":"some Description"}
end;
I downloaded and installed Arial Unicode MS.ttf and the generated pdf displays OK on my computer. However, when the PDF file is sent to another computer, chances are high that the latter doesn't have Arial Unicode MS.ttf installed, and all the unicode characters, including Greek, Arabic, etc. will not be displayed. All my Windows XP, Windows 7 & Windows 8 computers don't have that font preinstalled.
You can include the font subset to the file.
with TPdfDocument.Create do
try
EmbeddedTTF := True;
...
download@Arial Unicode MS - Version 1.01 at SourceForge.net
* ARIALUNI.TTF (23,275,812 bytes)
info@Arial Unicode MS - Version 1.01 | Microsoft Typography - Fonts and Products
synpdfunicode_test.rar (broken)
Check-in [25426a6933]
Date: 2013-03-21 14:50:03
D7(SynopseRTL), XE3-UP2,
WinXP-SP3(Korean),
Pages: 1