@wpsupport:
Hi,
I never came accross such a problem, esspecially not when exporting from WPTools. Did I understand correctly that the PDF looks different when you open it in on the desctop or download from the server?
Maybe the component uses CanvasReference set to Printer but the server does not have any?
Julian
Hi! Julian, the problem is not that. I'll try to explain better, but my english isn't so good.
This is the code I'm using to generate the pdf file:
wp_internet.Clear; wp_internet.CheckHasBody; GeraResultado(wp_resultado, CodPedido, CodExame); SetaConfigPaginaNet(wp_internet); wp_internet.AsString := wp_resultado.AsString; CabecalhoRodapeNet(wp_internet, CodPedido, CodExame); wp_internet.Refresh; WPPDFExport1.Source := wp_internet; WPPDFExport1.Filename := NetParametros.DiretorioTemp+'\result.pdf'; WPPDFExport1.Print;
The procedures I'm using:
procedure CabecalhoRodapeNet(var wpEditor: TWPRichText; CodigoPedido, CodigoExame: String);
var wpAuxiliar: TWPRichText;
i: Integer;
Lista: TStringList;
begin
CarregaCabRod(CodigoPedido, CodigoExame);
Lista := TStringList.Create;
wpAuxiliar := TWPRichText.Create(wpAuxiliar);
{Cabeçalho}
wpAuxiliar.AsString := NetParametros.TextoCabecalho;
GetTagList(wpAuxiliar, Lista);
for i := 0 to Lista.Count-1 do
ReplaceTags(wpAuxiliar, Lista[i], dmsis.t_cabrod.FieldByName(Lista[i]).AsString);
wpEditor.HeaderFooter.Get(wpIsHeader, wpraOnAllPages,'').RTFText.AsString := wpAuxiliar.AsANSIString('WPTOOLS');
{Rodapé}
wpAuxiliar.Clear;
wpAuxiliar.AsString := NetParametros.TextoRodape;
GetTagList(wpAuxiliar, Lista);
for i := 0 to Lista.Count-1 do
ReplaceTags(wpAuxiliar, Lista[i], dmsis.t_cabrod.FieldByName(Lista[i]).AsString);
wpEditor.HeaderFooter.Get(wpIsFooter, wpraOnAllPages,'').RTFText.AsString := wpAuxiliar.AsANSIString('WPTOOLS');
Lista.Free;
wpAuxiliar.Free;
end;
The wp_internet has the final formated text. When I preview it, all lokks good! But the pdf file generated from wp_internet not. It looks all messeu up. One thing I forget to mention: my header have a logo (bitmap). The final pdf file show only the logo, but incomplete and with very bigger height!!
Can yopu help me?
Thanks