Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm1.ExcelToPDF(const AFilename: string);
- Const
- XlTypePDF = 0;
- xlQualityStandard = 0;
- IncludeDocProperties = true;
- IgnorePrintAreas = false;
- LandscapeMode = 2;
- var
- P: OleVariant;
- begin
- P:= CreateOleObject('Excel.Application');
- try
- P.WorkBooks.Open(AFilename, 3);
- p.ActiveSheet.Pagesetup.Orientation := LandscapeMode; orientation
- p.ActiveSheet.PageSetup.FitToPagesWide := 1; // <-- not supported by automation object
- p.ActiveWorkbook.exportAsFixedFormat(xlTypePDF,
- AFilename,
- xlQualityStandard,
- IncludeDocProperties,
- IgnorePrintAreas );
- finally
- p.Quit;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement