Download:
(1) pdftk and winpdftextstamp 32 or 64 bit
(2) pdftk 1.pdf 2.pdf 3.pdf output file.pdf
(2) windpdftextstamp -ifile.pdf -ofile_n.pdf
Thursday, January 20, 2011
Install PDFCreator as NT Service using SC command
(1) Add PDFCreator to the exception list DEP
Control Panel => System => Advanced system settings =>Advanced => Data Execution Prevention.
(2) Ge srvany.exe from the Windows Server 2003 Resource Kit (There are no Windows 2008 Server Resource Kit as of today)
(3) create the service with the sc command:
sc create pdfcreator start= auto binPath= "C:\Program Files\oldResourceKitTools\srvany.exe" DisplayName= "PDFCreator" obj= DOMAIN\User password= password
(Note that there is one space after Equal Sign)
(4) sc query pdfcreator
(5) Reg editing as in KB137890 :
1. Regedt32.exe locate
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\pdfcreator
2.Add Key.
Key Name: Parameters
Class :<leave blank>
3.Select the Parameters key, Add Value.
Value Name: Application
Data Type : REG_SZsc start
String : <path>\<application.ext>
where <path>\<application.ext> is the drive and full path to the application executable including the extension (i.e., C:\PDFCreator\pdfcreator.exe)
Monday, January 17, 2011
Set up ghostscript PDL to convert xps to PDF
For 32 Bit:
Download binary e.g. ghostpdl-8.71-win32.zip http://www.ghostscript.com/releases/
unzip and find gswin32
command gxps-871.exe -sDEVICE=pdfwrite -sOutputFile=33.pdf -dNOPAUSE tiger.xps
For 64 Bit
download ghostpdl-9.00.tar.gz and get all the source
use VC++ nmake xps_msvc.mak to complike gxps.exe ( from 64 bit sdk prompt)
gxps -sDEVICE=pdfwrite -sOutputFile=77.pdf -sNOPAUSE tigger.xsp
CutePDF is a printer that convert any doc to PDF and can be programed in C#
(PopUp Dialog to save file). It uses ghostscript.
http://www.cutepdf.com/products/cutepdf/writer.asp
Walk WPF visual Tree and Logical Tree
public static List<T> GetChildren<T>(Visual parent) where T : Visual
{
List<T> childrenT = new List<T>();
int numOfChildren = VisualTreeHelper.GetChildrenCount(parent);
for (int i = 0; i < numOfChildren;i++ )
{
Visual v = (Visual)VisualTreeHelper.GetChild(parent, i);
if ((v as T) == null)
{
childrenT.AddRange(GetChildren<T>(v));
}
else childrenT.Add(v as T);
}
return childrenT;
}
public MainWindow() { InitializeComponent(); WalkVisualTree(g); WalkLogicalTree(g); } List<DependencyObject> listV = new List<DependencyObject>(); void WalkVisualTree(DependencyObject dobj) { for (int i = 0; i < VisualTreeHelper.GetChildrenCount(dobj); i++) { DependencyObject dobj2=VisualTreeHelper.GetChild(dobj, i); listV.Add(dobj2); WalkVisualTree(dobj2); } } List<FrameworkElement> listL = new List<FrameworkElement>(); void WalkLogicalTree(FrameworkElement dobj) { if (dobj == null) return; foreach ( var c in LogicalTreeHelper.GetChildren(dobj)) { listL.Add(c as FrameworkElement); WalkLogicalTree(c as FrameworkElement); } } }
Subscribe to:
Posts (Atom)