You are not logged in.
Pages: 1
I am not sure I understand what you meant, sorry.
Do you mean that your callback should return result = 200 so that it works as expected?
So is it solved?
Yes
I See, OnRequest call back shoud return HTTP_SUCCESS
OnRequest(Ctxt: THttpServerRequestAbstract): cardinal;
begin
Result:=HTTP_FOUND; //default return value
Ctxt.OutContentType:=TEXT_CONTENT_TYPE;
if StartWith(Ctxt.Url, uppercase('/upgradefile/')) then begin
Ctxt.OutContentType:=STATICFILE_CONTENT_TYPE;
ctxt.OutContent:=StringToUtf8('xxxxxxx');
ctxt.RespStatus:= HTTP_SUCCESS; ==> Result:=HTTP_SUCCESS;
end
end;
if Context.ContentFromFile(fn, CompressGz) then
OutContent := Context.Content ==> fRespStatus := HTTP_SUCCESS outContent no need
else
begin
FormatString('Impossible to find %', [fn], fErrorMessage);
fRespStatus := HTTP_NOTFOUND;
end;
follow :
Context.Content := OutContent; ==> if not ((OutContent <> '') and (OutContentType = STATICFILE_CONTENT_TYPE)) then Context.Content := OutContent;
Context.ContentType := OutContentType;
then can right download file
i Understand:
image is no Transparent property in pdf,so, should draw image first,then text out words.
var
Fpdf:TPdfDocumentGDI;
Apic:TGraphic;
begin
Fpdf:=TPdfDocumentGDI.Create;
Apic:=TBitmap.Create;
try
Fpdf.DefaultPaperSize:=psA4;
Fpdf.ScreenLogPixels:=Screen.PixelsPerInch;
Fpdf.AddPage;
Apic.LoadFromFile('d:\z.bmp');
Apic.Transparent:=True;
TBitmap(Apic).TransparentColor:=clWhite;
Fpdf.VCLCanvas.StretchDraw(Rect(20,20,20+Apic.Width,20+Apic.Height),Apic);
Fpdf.SaveToFile('d:\test.pdf');
finally
Apic.Free;
Fpdf.Free;
end;
------------------------------------------------
when pictuere with Transparent property set to be True,can not draw picture in pdf.
Pages: 1