-
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!
- Fotók, videók mobillal
- Hobby elektronika
- Cisco vizsgák (CCNA, CCNP, CCIE)
- Szinte meg sem jött, máris fogyókúrára fogták a Logitech Rapid Triggeres egerét
- Villanyszerelés
- Konzolokról KULTURÁLT módon
- Amlogic S905, S912 processzoros készülékek
- Vezetékes FEJhallgatók
- Gyúrósok ide!
- Luck Dragon: Asszociációs játék. :)
- További aktív témák...
- Hostpost.hu VPS és Webtárhely Bérlés
- Radeon Rx 6600XT/ I5 8400/ 16GB Corsair/ 1TB M2/ 128GB Sata SSD/ 500GB HDD/ Win11
- ÚJ Dobozos Lenovo Thinkpad T14s G6 Tartós Laptop 14" -60% Snapdragon 32/1TB FHD+ 20Hó Gar
- Bontatlan! Új Lenovo Thinkpad T14 G5 Tartós Üzleti Laptop 14" -45% Ultra 7 165U 16/512 FHD+ Magyar!
- Gtx 1060 6GB/ Ryzen 5 2600/ 16GB 2666/ 500GB SSD/ 500GB HDD/ Win11
- Gamer PC-Számítógép! Csere-Beszámítás! R7 5700 / RTX 2080Ti 11GB / 16GB DDR4 / 1TB Nvme SSD
- 5G LTE! Microsoft Surface Pro 8 i7-1185G7 16GB 512GB 1 év garancia
- HP Zbook Fury 17 G8 - üzletből, garanciával
- Acer Predator Helios 18 AI I9 ULTRA 9275HX, 192GB RAM, 2TB SSD, RTX 5080
- KÉSZLETKISÖPRÉSI UltraAkcióóó! MacBook Air M4 16GB 256GB Garancia - több színben!
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest

