-
Fototrend
Új hozzászólás Aktív témák
-
amargo
addikt
PDFSharp. Ez egy .NET es library.
GsPDF Ezt is érdemes megnézned.Igaz konzolos:
{$APPTYPE CONSOLE}
uses
Windows,SysUtils,ShellApi,Forms,ComObj,Variants;
var Input,InputNew : string;
FileTest : boolean;
App, AVDoc : Variant;
CoInitFlags : Integer = -1;
VarTest : IDispatch;
test : PVariant;
function RenameFile(const OldName, NewName: string): boolean;
//renames files, taken from
//http://www.dsdt.info/tipps/?id=128&search=RenameFile
var
sh: TSHFileOpStruct;
begin
sh.Wnd := Application.Handle;
sh.wFunc := fo_Rename;
//terminate with null byte to set list ending
sh.pFrom := PChar(OldName + #0);
sh.pTo := PChar(NewName + #0);
sh.fFlags := fof_Silent or fof_MultiDestFiles;
Result:=ShFileOperation(sh)=0;
end; //end function
begin //begin program
Application.Initialize;
//Read given filename
Input:= ParamStr(1);
//InputNew = original filename with ending "-preview" (e.g. test-preview.pdf)
InputNew:= copy(Input,1,Length(Input)-4); //remove ".pdf"
InputNew:= InputNew+'-preview.pdf';
//check if renamed file exists
FileTest:= FileExists(InputNew);
//Create OLE-object for the program Acrobat or Adobe Viewer
App:=CreateOleObject('AcroExch.App');
//test if given file already exists
if FileTest = true then
begin
//close old file
AVDoc:=App.GetActiveDoc; //handle of the active document
VarTest:=AVDoc;
test:= PVariant(VarTest);
if test <> PVariant(0) then //when handle is existing
begin
try
AVDoc.Close(true);
except
Application.Terminate;
end;
end;
//delete old file
DeleteFile(InputNew);
end; //end if FileTest
//rename file
RenameFile(Input,InputNew);
//open renamed file in Acobat or Adobe Viewer
App.Show; //show window
App.Restore(true); //restore window size to make window active
App.Maximize(true); //maximize window
AVDoc:=CreateOleObject('AcroExch.AVDoc'); //create OLE object for file
AVDoc.Open(''+InputNew+'',''); //open file
end. //end program
Új hozzászólás Aktív témák
● olvasd el a téma összefoglalót!
- Ohh Lenovo ThinkPad P15 G2 Tervező Vágó Laptop -75% 15,6" i5-11500H 32/1TB RTX A2000 4GB /1 Millió/
- UHH! HP EliteBook 850 G8 Fémházas Multimédiás Laptop 15,6" -40% i7-1165G7 16/512 Iris Xe FHD EU-HUN
- IBM PS/1 2168-552 486SX-25
- ASUS ROG Strix RTX 2080 Ti OC 11GB
- Acer Swift 3 (SF314 54) i5 / 8GB RAM / SSD / FullHD / kiváló állapotban!
- Dell Latitude 5495 Full HD IPS Ryzen 5 pro 2500u Radeon Vega Mobile Gfx i5-8350u verő Bp MPL Foxpost
- Csere- Beszámítás! Asus Rog Strix B550-F Gaming Wi-Fi II Alaplap
- Felújított szerverek, storage-ok, hálózati eszközök Enterprise szinten, minden gyártótól
- Csere-Beszámítás! Corsair Dominator Platinum 2x32GB (64GB) Kit 5200MHZ DDR5
- ÁRGARANCIA!Épített KomPhone Ryzen 5 4500 16/32/64GB RAM RX 6600 8GB GAMER PC termékbeszámítással
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest