-
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!
- Milyen routert?
- Folyószámla, bankszámla, bankváltás, külföldi kártyahasználat
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Lenovo Thinkbook, Yoga széria
- TCL LCD és LED TV-k
- Metal topik
- A nagy Szóda, Szódakészítés topic - legyen egy kis fröccs is! :-)
- 5.1, 7.1 és gamer fejhallgatók
- Mesterséges intelligencia topik
- Túl jól fogy az S26, túlóráznia kell a gyártósoroknak
- További aktív témák...
- Gamer PC - i5 / GTX 960/12 Gb Ram (Erősebb, mint a 1050 Ti!)
- Eladó AKG Ara, dupla kapszulás mikrofon! Bontatlan, garanciás! Több darab is elérhető!
- Logitech Superstrike x2
- D-link 16 és 24 portos, sima és POE, gigabites managelhető switchek
- Gigabyte H510M PRO-E alaplap + Intel Core i5 10400F CPU (+ram, táp, vga igény szerint)
- HP EliteBook 840 G7 i5-10210U 16GB 256GB FHD 400nit 1 év garancia
- M5! KÉSZLETKISÖPRÉSI ULTRAAKCIÓ!!! SPACE BLACK MacBook Pro 14" M5!!! 10C/10G 16GB 512GB Gar!
- BESZÁMÍTÁS! Microsoft XBOX Series S 512GB játékkonzol garanciával hibátlan működéssel
- Értékcsökkentett gamer alaplapok /ASUS/MSI/AM5/Számlával/
- Lenovo L13 G2 Core i5 1135G7 Intel Iris XE 8Gb Ram 256Gb NVMe SSD Boltból Garanciával Számlával
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest

