You are not logged in.
Pages: 1
Ok, of course this is the last you see of me here, I think this deserve at least a yes or no, bye.
Hi, I don't know really if this is on purpose, but I think that the NewDoc procedure should clear the pages. At least in my app before each NewDoc I have to clear them. Regards.
I guess that if the font is not embedded and not installed then it wouldn't draw correctly, and for the copy and pasting thing it would need to be installed, I guess that from Acrobat or with any app that can read pdf this could be done, if the font is embedded. Bye bye.
Hello, with this code:
var
doc:TPdfdocumentgdi;
lpage:tpdfpage;
begin
doc:=tpdfdocumentgdi.Create;
doc.DefaultPaperSize:=psA5;
doc.EmbeddedTTF:=true;
doc.EmbeddedWholeTTF:=true;
lpage:=doc.AddPage;
with doc.VCLCanvas do
begin
Font.Name:='HelvMono';
Font.Style:=[];
Font.Size:=12;
Font.Color:=0;
TextOut(10,10,'something');
end;
end;
It draws correct the text, and when the font is installed, selecting text and copying with format from acrobat and then opening and pasting in wordpad, for example, you see that in fact the font is HelvMono. But this is so even if you don't use EmbeddedTTF. Instead, if you uninstall the font, then even using EmbeddedTTF, after pasting in wordpad, the font is Arial.
It's possible that this is the way is intended or there is something additional to do, perhaps within acrobat, but I think it shouldn't, if you embed the font is for things like copying with format and pasting would work. Thanks so much.
Thank you.
Hello, thanks for this library. In this piece of code:
lPDf:=TPDFDocumentGDI.Create;
try
lPage := lPDF.AddPage;
lPage.PageWidth:=413;
lPage.PageHeight:=556;
with lPDF.VCLCanvas do
begin
mmode:=SetMapMode(Handle,MM_ANISOTROPIC);
SetWindowExtEx(Handle,413,556,@oldwi);
SetViewportExtEx(Handle,Round(((413/2.835)*96)/25.4),
Round(((556/2.835)*96)/25.4),@oldvi);
p:=Point(0,16);
DPtoLP(Handle,p,1);
Font.Height:=-p.Y;
Font.Name:='Arial';
s:='any string with four spaces';
GetTextExtentPoint32(Handle,PChar(s),Length(s),sz);
SetTextJustification(Handle,393-sz.cx,4);
TextOut(10,10,s);
SetTextJustification(Handle,0,0);
SetViewPOrtExtEx(Handle,oldvi.cx,oldvi.cy,nil);
SEtWindowExtEx(Handle,oldwi.cx,oldwi.cy,nil);
SetMapMode(Handle,mmode);
end;
As you see, in setviewport I transform the window extensions to the values in pixels, taking in account the values in the procedure: SetDefaultPaperSize in synpdf.pas.
sz.cx seems to report the correct amount and the font seems to be of the good size, so why SetTextJustification does nothing and the result is correct but without justification? Very appreciated, cheers.
Pages: 1