119
:: Home
:: About Us
:: Products
:: Consulting
:: Support
:: Contact Us
Neevia Technology
"Changing the way people
view, share and work
with e-documents"
Example 11: Convert 3 TIFF files into a single PDF from ASP.NET
1) Configure docCreator like recommended below:
l
type dcomcnfg in the command prompt and press Enter;
l
find and select docCreator DCOM in the Applications list, then press the Properties
button;
If you have windows 2003 then type dcomcnfg in the command prompt, expand the Component
Services group, expand the Computers group, expand the My Computer group, expand the
DCOM Config group, find and select the docCreator DCOM library->right mouse click-
>Properties.
l
click the Identity tab. Check the "This user" checkbox, press Browse and specify
the Administrator account;
l
enter and re-enter the Administrator password;
l
click the Security tab. Check the Use custom access permissions checkbox, press
Edit and add the ASPNET, IUSR_<machine_name> and IWAM_<machine_name>
user accounts;
Note: If you have windows 2003 also add the "NETWORK SERVICE" user account;
l
check the "Use custom launch permissions" checkbox, press Edit and add the
ASPNET, IUSR_<machine_name> and IWAM_<machine_name> user accounts;
Note: If you have windows 2003 also add the "NETWORK SERVICE" user account;
l
reboot the computer;
2) Add in your project a reference to the c:\program files\neevia.com\document creator\.net
\doc_Creator.dll assembly;
Visual Basic
<SCRIPT runat="server" language="VB">
Sub Page_Load(Source As Object, e As EventArgs)
Dim DC As New doc_Creator.Application
Dim Images(3) As String
Images(0) = "c:\test1.tif"
Images(1) = "c:\test2.tif"
Images(2) = "c:\test3.tif"
Dim RVal, I As Integer
For I = 0 To UBound(Images)-1
DC.ConvertImage(Images(I), "c:\out" & I & ".ps")
DC.DocumentOutputFormat = "PDF"
DC.DocumentOutputFolder = "c:\"
DC.DocumentOutputName = "out" & I
RVal = DC.SetInputDocument("c:\out" & I & ".ps")
RVal = DC.Create ' Create output document
If (RVal <> 0) Then Response.Write("Error while creating document!!!")
DC.FileDelete("c:\out" & i & ".ps")
Next
For I = 1 To UBound(Images) - 1
DC.MergePDF("c:\out" & I - 1 & ".PDF", "c:\out" & I & ".PDF", "c:\out" & I & ".PDF")
DC.FileDelete("c:\out" & I - 1 & ".PDF")
Next
DC = Nothing
Response.Write("Done Converting !!!")
End Sub
</SCRIPT>
VC#
<SCRIPT runat="server" language="C#">
void Page_Load(object Source, EventArgs e)
{
doc_Creator.Application DC = new doc_Creator.Application();
string[]Images = new string[3];
Images[0]=@"c:\test1.tif";
Images[1]=@"c:\test2.tif";
Images[2]=@"c:\test3.tif";
int RVal;
for(int I=0; I<=2; I++){
DC.ConvertImage(Images[I], @"c:\out"+I+".ps");
DC.DocumentOutputFormat = "PDF";
DC.DocumentOutputFolder = @"c:\";
DC.DocumentOutputName = "out" + I;
RVal = DC.SetInputDocument(@"c:\out"+ I +".ps","");
RVal = DC.Create();
if (RVal != 0) {
Response.Write("Error while creating document!!!");
}
DC.FileDelete(@"c:\out"+ I +".ps");
}
for (int I = 1; I <= 2;I++ ) {
int j = I - 1;
DC.MergePDF(@"c:\out" + j + ".PDF",
@"c:\out" + I + ".PDF", @"c:\out" + I + ".PDF");
DC.FileDelete(@"c:\out" + j + ".PDF");
}
Response.Write("Done !!!");
}
</SCRIPT>
We use Document
Converter Pro for
converting various
document formats into
PDF and have been
impressed by the speed
and flexibility of your application.
More importantly for us it was the
quality of the support we have
received. From the first email our
requests have been handled
efficiently and promptly. The
standard of service is excellent.
Alessandra Desandi
CargoTrans SpA
If you have any comments
or suggestions about our
web site, please feel free to
email them to web@neevia.
com.
Home | About Us | Products | Consulting | Support | Contact Us
© 1999-2005 Neevia Technology, Inc