Advertisement
infotecjf

Untitled

Sep 20th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. PDFDoc := TgtPDFDocument.Create(nil);
  2. try
  3. oWatermark := TgtImageWatermarkTemplate.Create;
  4. try
  5. PDFDoc.LoadFromFile(sTmpPDF);
  6. with PDFDoc do
  7. begin
  8. if IsLoaded then
  9. begin
  10. with oWatermark do
  11. begin
  12. ImageFormat := ofBMP;
  13. Name := 'CIDAP';
  14. Image := Vcl.Graphics.TBitmap.Create;
  15. //Image.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'Watermark.bmp');
  16. Overlay := False;
  17. OpacityFill := 75;
  18. HorizPos := hpCenter;
  19. VertPos := vpMiddle;
  20. end;
  21.  
  22. InsertWatermark(oWatermark);
  23.  
  24. SaveToFile(sTmpWMFile);
  25. Reset;
  26. end;
  27. end;
  28. finally
  29. oWatermark.Free;
  30. end;
  31. finally
  32. PDFDoc.Free;
  33. end;
  34.  
  35. DeleteFile(sTmpPDF);
  36.  
  37. sTmpPDF := sTmpWMFile;
  38. end;
  39.  
  40. bDeleteFile := True;
  41.  
  42. if AssinarLaudo(sCertList) then
  43. sTmpPDF := SignPDFDoc(sTmpPDF, sCertList);
  44. end;
  45. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement