-
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!
- PayPal
- AliExpress tapasztalatok
- Racoon City árnyékában: Teszteltük a Resident Evil Requiemet
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Itt a Galaxy S26 széria: az Ultra fejlődött, a másik kettő alig
- eBay
- Épített vízhűtés (nem kompakt) topic
- Honor Magic8 Pro - bevált recept kölcsönvett hozzávalókkal
- Xbox Series X|S
- PlayStation 5
- További aktív témák...
- Honor 200 Lite 256GB, Kártyafüggetlen, 1 Év Garanciával
- BESZÁMÍTÁS! Gigabyte B450M R5 2600X 16GB DDR4 512GB SSD GTX 1650 4GB ZALMAN T3 Plus Deepcool 400W
- Samsung Galaxy A35 5G 6/128GB / 12 hó jótállás
- Szuper áron eladó Honor MagicBook 16 Series /Ryzen5-5600H/16GB/512 SSD/FHD/IPS/144Hz
- LG 65G5 - 65" OLED Tandem - 4K 165Hz & 0.1ms - MLA Plus - 4000 Nits - NVIDIA G-Sync - FreeSync
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest

