-
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!
- DOOM - The Dark Ages
- exHWSW - Értünk mindenhez IS
- Philips LCD és LED TV-k
- Kerékpárosok, bringások ide!
- Macska topik
- Ingyen és modern rendszerekre szánva tér vissza az Unreal Tournament 2004
- Mibe tegyem a megtakarításaimat?
- Nvidia GPU-k jövője - amit tudni vélünk
- Windows 11
- Végre 120 Hz-es lesz az Apple következő monitora
- További aktív témák...
- Xbox Elite Series 2 kontroller 3 hó garancia, számlával!
- iPhone 14 Pro 128GB gyári független szép állapotú
- Sosemhasznált! HP OmniBook 5 i7-1355U 16GB 512GB 16" FHD+ Gar.: 1 év
- Samsung Odyssey G5 C32G55TQWR 32 Ívelt 1000R WQHD Gamer Monitor 6 hó garancia Házhozszállítás
- Playstation Portal 6 hó garancia, számlával!
- LG 27GR95QE - 27" OLED / QHD 2K / 240Hz & 0.03ms / NVIDIA G-Sync / FreeSync Premium / HDMI 2.1
- 2db Samsung Galaxy A6 32GB (Kijelző törött)
- Dell Alienware AW3423DW 34 QD-OLED Gaming Monitor 27% ÁFÁS
- Honor 90 /12/512GB / Kártyafüggetlen / 12Hó Garancia
- LG 27UP850K-W - 27" IPS LED - 3840x2160 4K - DisplayHDR 400 - USB Type-C - AMD FreeSync
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Laptopszaki Kft.
Város: Budapest


