Calling Assembly from ASP

View: New views
19 Messages — Rating Filter:   Alert me  

Calling Assembly from ASP

by Shawn Davies :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hello,

 

I’m new to this mailing list, so I hope I’m posting my question correctly. J

 

I wrote a class that uses iTextSharp to create a PDF document. This works great in my .NET web site. Going forward, I have some classic ASP pages in which I would like to implement this assembly, and I’ve run into a bit of a snag.

 

My ASP code:

<%

  Dim myObject

        Dim output

        Dim strConStr

        strConStr = Application("Connection_String") & ";Workstation ID='" & Request.Cookies.Item("UserID") & "'"

        set myObject = Server.CreateObject("CustomPDF.CreatePdf")

        output = myObject.CreatePdfData(strConStr, 150000, strSQL, "AdInventory", "OutputPdf.pdf")

        myObject = nothing

        Response.ContentType = "application/pdf"

        Response.AddHeader "Content-Disposition", "filename=OutputPdf.pdf" '&strFilename

        Response.Write(output)

%>

 

The “CustomPDF.CreatePDF” class is C# written on the 2.0 Framework. I’m executing this code on a website running on Windows 2003 server. When I run the above code, I get the error below. The “CustomPDF.CreatePdf” class is being instantiated, but the error is thrown when I make the call to “CreatePdfData”.

ExportToPDF error '80070002'

Could not load file or assembly 'itextsharp, Version=4.1.2.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its dependencies. The system cannot find the file specified.

1.       I added iTextSharp.dll to the GAC.

2.       I successfully registered my dll and the iTextSharp.dll using regasm.exe (2.0 framework).

 

Can anyone tell me why the system can’t find iTextSharp?

 

Thanks!

Shawn

 

Shawn Davies

Senior Software Engineer, Macrovision Solutions Corporation

Shawn.Davies@... |  Office: 918-488-4052 |  Fax: 918-488-4245

 

  

CONFIDENTIALITY NOTICE: This email message (including any attachments) is for the sole use of the intended recipient and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Thank you.

 

 


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: Calling Assembly from ASP

by Paulo Soares-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Maybe it can find the assembly but you are not running fully trusted.

Paulo

----- Original Message -----
From: "Shawn Davies" <Shawn.Davies@...>
To: <itextsharp-questions@...>
Sent: Friday, June 05, 2009 8:32 PM
Subject: [itextsharp-questions] Calling Assembly from ASP


Hello,

I’m new to this mailing list, so I hope I’m posting my question correctly.
:)

I wrote a class that uses iTextSharp to create a PDF document. This works
great in my .NET web site. Going forward, I have some classic ASP pages in
which I would like to implement this assembly, and I’ve run into a bit of a
snag.

My ASP code:
<%
  Dim myObject
        Dim output
        Dim strConStr
        strConStr = Application("Connection_String") & ";Workstation ID='" &
Request.Cookies.Item("UserID") & "'"
        set myObject = Server.CreateObject("CustomPDF.CreatePdf")
        output = myObject.CreatePdfData(strConStr, 150000, strSQL,
"AdInventory", "OutputPdf.pdf")
        myObject = nothing
        Response.ContentType = "application/pdf"
        Response.AddHeader "Content-Disposition", "filename=OutputPdf.pdf"
'&strFilename
        Response.Write(output)
%>

The “CustomPDF.CreatePDF” class is C# written on the 2.0 Framework. I’m
executing this code on a website running on Windows 2003 server. When I run
the above code, I get the error below. The “CustomPDF.CreatePdf” class is
being instantiated, but the error is thrown when I make the call to
“CreatePdfData”.

ExportToPDF error '80070002'

Could not load file or assembly 'itextsharp, Version=4.1.2.0,
Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its
dependencies. The system cannot find the file specified.

1.       I added iTextSharp.dll to the GAC.

2.       I successfully registered my dll and the iTextSharp.dll using
regasm.exe (2.0 framework).

Can anyone tell me why the system can’t find iTextSharp?

Thanks!
Shawn

Shawn Davies
Senior Software Engineer, Macrovision Solutions Corporation
Shawn.Davies@... |  Office: 918-488-4052 |  Fax: 918-488-4245


CONFIDENTIALITY NOTICE: This email message (including any attachments) is
for the sole use of the intended recipient and may contain confidential and
privileged information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply email and destroy all copies of the original
message. Thank you.




------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: Calling Assembly from ASP

by Shawn Davies :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for your response. I used the Framework config tool to change the
permissions for the Local_Intranet zone to "Full Trust". Same results. I
would think that if there was a security issue, it would have popped-up
when the object was instantiated using "Server.CreateObject".


Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: Paulo Soares [mailto:psoares@...]
Sent: Friday, June 05, 2009 2:59 PM
To: Post all your questions about iTextSharp here
Subject: Re: [itextsharp-questions] Calling Assembly from ASP

Maybe it can find the assembly but you are not running fully trusted.

Paulo

----- Original Message -----
From: "Shawn Davies" <Shawn.Davies@...>
To: <itextsharp-questions@...>
Sent: Friday, June 05, 2009 8:32 PM
Subject: [itextsharp-questions] Calling Assembly from ASP


Hello,

I'm new to this mailing list, so I hope I'm posting my question
correctly.
:)

I wrote a class that uses iTextSharp to create a PDF document. This
works
great in my .NET web site. Going forward, I have some classic ASP pages
in
which I would like to implement this assembly, and I've run into a bit
of a
snag.

My ASP code:
<%
  Dim myObject
        Dim output
        Dim strConStr
        strConStr = Application("Connection_String") & ";Workstation
ID='" &
Request.Cookies.Item("UserID") & "'"
        set myObject = Server.CreateObject("CustomPDF.CreatePdf")
        output = myObject.CreatePdfData(strConStr, 150000, strSQL,
"AdInventory", "OutputPdf.pdf")
        myObject = nothing
        Response.ContentType = "application/pdf"
        Response.AddHeader "Content-Disposition",
"filename=OutputPdf.pdf"
'&strFilename
        Response.Write(output)
%>

The "CustomPDF.CreatePDF" class is C# written on the 2.0 Framework. I'm
executing this code on a website running on Windows 2003 server. When I
run
the above code, I get the error below. The "CustomPDF.CreatePdf" class
is
being instantiated, but the error is thrown when I make the call to
"CreatePdfData".

ExportToPDF error '80070002'

Could not load file or assembly 'itextsharp, Version=4.1.2.0,
Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its
dependencies. The system cannot find the file specified.

1.       I added iTextSharp.dll to the GAC.

2.       I successfully registered my dll and the iTextSharp.dll using
regasm.exe (2.0 framework).

Can anyone tell me why the system can't find iTextSharp?

Thanks!
Shawn

Shawn Davies
Senior Software Engineer, Macrovision Solutions Corporation
Shawn.Davies@... |  Office: 918-488-4052 |  Fax:
918-488-4245


CONFIDENTIALITY NOTICE: This email message (including any attachments)
is
for the sole use of the intended recipient and may contain confidential
and
privileged information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient,
please
contact the sender by reply email and destroy all copies of the original

message. Thank you.




------------------------------------------------------------------------
------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the
latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: Calling Assembly from ASP

by Fabrizio Accatino :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


- give the full exception

- place itextsharp dll in the same folder of CustomPdf.CreatePdf dll.  And try again.


   fabrizio




On Fri, Jun 5, 2009 at 10:20 PM, Shawn Davies <Shawn.Davies@...> wrote:
Thanks for your response. I used the Framework config tool to change the
permissions for the Local_Intranet zone to "Full Trust". Same results. I
would think that if there was a security issue, it would have popped-up
when the object was instantiated using "Server.CreateObject".


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: Calling Assembly from ASP

by Shawn Davies :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

I was finally able to get my class to run and generate a pdf from ASP code. Whew!

 

After running regasm, I didn’t think I needed them in the GAC - so I removed my previous entries. Once I added them back in, it started working as designed.

 

I have my development machine updated with the Reader 9, the PDF opens fine from ASP code – although I noticed it opens in the browser window. When I use the same class to create a PDF from managed code, it opens an separate Adobe Reader window containing the output. This may be a browser setting.

 

I just tried Adobe 7 and “The file is damaged and could not be repaired” from Reader. Any ideas about why? It works fine when calling from C# (versus ASP). ???

 

Thanks!

Shawn

 

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245

 

From: Fabrizio Accatino [mailto:fhtino@...]
Sent: Monday, June 08, 2009 1:40 AM
To: Post all your questions about iTextSharp here
Subject: Re: [itextsharp-questions] Calling Assembly from ASP

 

 

- give the full exception

 

- place itextsharp dll in the same folder of CustomPdf.CreatePdf dll.  And try again.

 

 

   fabrizio

 

 

 

On Fri, Jun 5, 2009 at 10:20 PM, Shawn Davies <Shawn.Davies@...> wrote:

Thanks for your response. I used the Framework config tool to change the
permissions for the Local_Intranet zone to "Full Trust". Same results. I
would think that if there was a security issue, it would have popped-up
when the object was instantiated using "Server.CreateObject".

 


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: Calling Assembly from ASP

by Paulo Soares-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Don't forget to set the content length.

Paulo

> -----Original Message-----
> From: Shawn Davies [mailto:Shawn.Davies@...]
> Sent: Monday, June 08, 2009 3:13 PM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] Calling Assembly from ASP
>
> I was finally able to get my class to run and generate a pdf
> from ASP code. Whew!
>
>  
>
> After running regasm, I didn't think I needed them in the GAC
> - so I removed my previous entries. Once I added them back
> in, it started working as designed.
>
>  
>
> I have my development machine updated with the Reader 9, the
> PDF opens fine from ASP code - although I noticed it opens in
> the browser window. When I use the same class to create a PDF
> from managed code, it opens an separate Adobe Reader window
> containing the output. This may be a browser setting.
>
>  
>
> I just tried Adobe 7 and "The file is damaged and could not
> be repaired" from Reader. Any ideas about why? It works fine
> when calling from C# (versus ASP). ???
>
>  
>
> Thanks!
>
> Shawn
>
>  
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax:
> 918-488-4245
>
>  
>
> From: Fabrizio Accatino [mailto:fhtino@...]
> Sent: Monday, June 08, 2009 1:40 AM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] Calling Assembly from ASP
>
>  
>
>  
>
> - give the full exception
>
>  
>
> - place itextsharp dll in the same folder of
> CustomPdf.CreatePdf dll.  And try again.
>
>  
>
>  
>
>    fabrizio
>
>  
>
>  
>
>  
>
> On Fri, Jun 5, 2009 at 10:20 PM, Shawn Davies
> <Shawn.Davies@...> wrote:
>
> Thanks for your response. I used the Framework config tool to
> change the
> permissions for the Local_Intranet zone to "Full Trust". Same
> results. I
> would think that if there was a security issue, it would have
> popped-up
> when the object was instantiated using "Server.CreateObject".

Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.



------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Parent Message unknown FW: Calling Assembly from ASP

by Shawn Davies :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

I fixed everything – even for Acrobat Reader 7. The file was opening inline because I wasn’t specifying “attachment” in the content header.

 

Reader 7 couldn’t handle what I was writing out because I didn’t call Response.End after calling Response.BinaryWrite. It was obviously tacking http output onto the response stream.

 

Thanks All!

 

 

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245

 

From: Shawn Davies
Sent: Monday, June 08, 2009 9:13 AM
To: Post all your questions about iTextSharp here
Subject: RE: [itextsharp-questions] Calling Assembly from ASP

 

I was finally able to get my class to run and generate a pdf from ASP code. Whew!

 

After running regasm, I didn’t think I needed them in the GAC - so I removed my previous entries. Once I added them back in, it started working as designed.

 

I have my development machine updated with the Reader 9, the PDF opens fine from ASP code – although I noticed it opens in the browser window. When I use the same class to create a PDF from managed code, it opens an separate Adobe Reader window containing the output. This may be a browser setting.

 

I just tried Adobe 7 and “The file is damaged and could not be repaired” from Reader. Any ideas about why? It works fine when calling from C# (versus ASP). ???

 

Thanks!

Shawn

 

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245

 

From: Fabrizio Accatino [mailto:fhtino@...]
Sent: Monday, June 08, 2009 1:40 AM
To: Post all your questions about iTextSharp here
Subject: Re: [itextsharp-questions] Calling Assembly from ASP

 

 

- give the full exception

 

- place itextsharp dll in the same folder of CustomPdf.CreatePdf dll.  And try again.

 

 

   fabrizio

 

 

 

On Fri, Jun 5, 2009 at 10:20 PM, Shawn Davies <Shawn.Davies@...> wrote:

Thanks for your response. I used the Framework config tool to change the
permissions for the Local_Intranet zone to "Full Trust". Same results. I
would think that if there was a security issue, it would have popped-up
when the object was instantiated using "Server.CreateObject".

 


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: Calling Assembly from ASP

by Shawn Davies :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a question regarding images and iTextSharp...

Is there a way to get it to resolve URLs that begin with "<img src=file:" versus "<img src=http:"?? iTextSharp will resolve image paths if the path is a URL, but all I get is the filename if the source is "file:".

Thanks!
Shawn

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: Paulo Soares [mailto:psoares@...]
Sent: Monday, June 08, 2009 9:17 AM
To: Post all your questions about iTextSharp here
Subject: Re: [itextsharp-questions] Calling Assembly from ASP

Don't forget to set the content length.

Paulo

> -----Original Message-----
> From: Shawn Davies [mailto:Shawn.Davies@...]
> Sent: Monday, June 08, 2009 3:13 PM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] Calling Assembly from ASP
>
> I was finally able to get my class to run and generate a pdf from ASP
> code. Whew!
>
>  
>
> After running regasm, I didn't think I needed them in the GAC
> - so I removed my previous entries. Once I added them back in, it
> started working as designed.
>
>  
>
> I have my development machine updated with the Reader 9, the PDF opens
> fine from ASP code - although I noticed it opens in the browser
> window. When I use the same class to create a PDF from managed code,
> it opens an separate Adobe Reader window containing the output. This
> may be a browser setting.
>
>  
>
> I just tried Adobe 7 and "The file is damaged and could not be
> repaired" from Reader. Any ideas about why? It works fine when calling
> from C# (versus ASP). ???
>
>  
>
> Thanks!
>
> Shawn
>
>  
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax:
> 918-488-4245
>
>  
>
> From: Fabrizio Accatino [mailto:fhtino@...]
> Sent: Monday, June 08, 2009 1:40 AM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] Calling Assembly from ASP
>
>  
>
>  
>
> - give the full exception
>
>  
>
> - place itextsharp dll in the same folder of CustomPdf.CreatePdf dll.  
> And try again.
>
>  
>
>  
>
>    fabrizio
>
>  
>
>  
>
>  
>
> On Fri, Jun 5, 2009 at 10:20 PM, Shawn Davies
> <Shawn.Davies@...> wrote:
>
> Thanks for your response. I used the Framework config tool to change
> the permissions for the Local_Intranet zone to "Full Trust". Same
> results. I would think that if there was a security issue, it would
> have popped-up when the object was instantiated using
> "Server.CreateObject".


Aviso Legal:

Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.



Disclaimer:

This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.




------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Parent Message unknown FW: Calling Assembly from ASP

by Shawn Davies :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Any recommendations regarding this?

Thanks,
Shawn

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: Shawn Davies
Sent: Monday, June 08, 2009 2:46 PM
To: Post all your questions about iTextSharp here
Subject: RE: [itextsharp-questions] Calling Assembly from ASP

I have a question regarding images and iTextSharp...

Is there a way to get it to resolve URLs that begin with "<img src=file:" versus "<img src=http:"?? iTextSharp will resolve image paths if the path is a URL, but all I get is the filename if the source is "file:".

Thanks!
Shawn

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: Paulo Soares [mailto:psoares@...]
Sent: Monday, June 08, 2009 9:17 AM
To: Post all your questions about iTextSharp here
Subject: Re: [itextsharp-questions] Calling Assembly from ASP

Don't forget to set the content length.

Paulo

> -----Original Message-----
> From: Shawn Davies [mailto:Shawn.Davies@...]
> Sent: Monday, June 08, 2009 3:13 PM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] Calling Assembly from ASP
>
> I was finally able to get my class to run and generate a pdf from ASP
> code. Whew!
>
>  
>
> After running regasm, I didn't think I needed them in the GAC
> - so I removed my previous entries. Once I added them back in, it
> started working as designed.
>
>  
>
> I have my development machine updated with the Reader 9, the PDF opens
> fine from ASP code - although I noticed it opens in the browser
> window. When I use the same class to create a PDF from managed code,
> it opens an separate Adobe Reader window containing the output. This
> may be a browser setting.
>
>  
>
> I just tried Adobe 7 and "The file is damaged and could not be
> repaired" from Reader. Any ideas about why? It works fine when calling
> from C# (versus ASP). ???
>
>  
>
> Thanks!
>
> Shawn
>
>  
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax:
> 918-488-4245
>
>  
>
> From: Fabrizio Accatino [mailto:fhtino@...]
> Sent: Monday, June 08, 2009 1:40 AM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] Calling Assembly from ASP
>
>  
>
>  
>
> - give the full exception
>
>  
>
> - place itextsharp dll in the same folder of CustomPdf.CreatePdf dll.  
> And try again.
>
>  
>
>  
>
>    fabrizio
>
>  
>
>  
>
>  
>
> On Fri, Jun 5, 2009 at 10:20 PM, Shawn Davies
> <Shawn.Davies@...> wrote:
>
> Thanks for your response. I used the Framework config tool to change
> the permissions for the Local_Intranet zone to "Full Trust". Same
> results. I would think that if there was a security issue, it would
> have popped-up when the object was instantiated using
> "Server.CreateObject".


Aviso Legal:

Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.



Disclaimer:

This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.




------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: FW: Calling Assembly from ASP

by Paulo Soares-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You'll have to phrase your question better.

Paulo

----- Original Message -----
From: "Shawn Davies" <Shawn.Davies@...>
To: "Post all your questions about iTextSharp here"
<itextsharp-questions@...>
Sent: Monday, June 08, 2009 11:45 PM
Subject: [itextsharp-questions] FW: Calling Assembly from ASP


Any recommendations regarding this?

Thanks,
Shawn

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: Shawn Davies
Sent: Monday, June 08, 2009 2:46 PM
To: Post all your questions about iTextSharp here
Subject: RE: [itextsharp-questions] Calling Assembly from ASP

I have a question regarding images and iTextSharp...

Is there a way to get it to resolve URLs that begin with "<img src=file:"
versus "<img src=http:"?? iTextSharp will resolve image paths if the path is
a URL, but all I get is the filename if the source is "file:".

Thanks!
Shawn

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: Paulo Soares [mailto:psoares@...]
Sent: Monday, June 08, 2009 9:17 AM
To: Post all your questions about iTextSharp here
Subject: Re: [itextsharp-questions] Calling Assembly from ASP

Don't forget to set the content length.

Paulo

> -----Original Message-----
> From: Shawn Davies [mailto:Shawn.Davies@...]
> Sent: Monday, June 08, 2009 3:13 PM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] Calling Assembly from ASP
>
> I was finally able to get my class to run and generate a pdf from ASP
> code. Whew!
>
>
>
> After running regasm, I didn't think I needed them in the GAC
> - so I removed my previous entries. Once I added them back in, it
> started working as designed.
>
>
>
> I have my development machine updated with the Reader 9, the PDF opens
> fine from ASP code - although I noticed it opens in the browser
> window. When I use the same class to create a PDF from managed code,
> it opens an separate Adobe Reader window containing the output. This
> may be a browser setting.
>
>
>
> I just tried Adobe 7 and "The file is damaged and could not be
> repaired" from Reader. Any ideas about why? It works fine when calling
> from C# (versus ASP). ???
>
>
>
> Thanks!
>
> Shawn
>
>
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax:
> 918-488-4245
>
>
>
> From: Fabrizio Accatino [mailto:fhtino@...]
> Sent: Monday, June 08, 2009 1:40 AM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] Calling Assembly from ASP
>
>
>
>
>
> - give the full exception
>
>
>
> - place itextsharp dll in the same folder of CustomPdf.CreatePdf dll.
> And try again.
>
>
>
>
>
>    fabrizio
>
>
>
>
>
>
>
> On Fri, Jun 5, 2009 at 10:20 PM, Shawn Davies
> <Shawn.Davies@...> wrote:
>
> Thanks for your response. I used the Framework config tool to change
> the permissions for the Local_Intranet zone to "Full Trust". Same
> results. I would think that if there was a security issue, it would
> have popped-up when the object was instantiated using
> "Server.CreateObject".


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: FW: Calling Assembly from ASP

by Joe Lynds :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, Shawn--

Here's how I do it:

Dim sArrowFileName As String = "c:\images\mathcoder\r-arrow.gif"
Dim oArrowBitMap As Drawing.Image = Drawing.Image.FromFile(sArrowFileName)
Dim oArrowImage As iTextSharp.text.Image =
Image.GetInstance(oArrowBitMap,
System.Drawing.Imaging.ImageFormat.Gif)
...
...
oDoc.Add(oArrowImage)

Regards,

-Joe

http://www.jlion.com


> ----- Original Message -----
> From: "Shawn Davies" <Shawn.Davies@...>
> To: "Post all your questions about iTextSharp here"
> <itextsharp-questions@...>
> Sent: Monday, June 08, 2009 11:45 PM
> Subject: [itextsharp-questions] FW: Calling Assembly from ASP
>
>
> Any recommendations regarding this?
>
> Thanks,
> Shawn
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>
>
> -----Original Message-----
> From: Shawn Davies
> Sent: Monday, June 08, 2009 2:46 PM
> To: Post all your questions about iTextSharp here
> Subject: RE: [itextsharp-questions] Calling Assembly from ASP
>
> I have a question regarding images and iTextSharp...
>
> Is there a way to get it to resolve URLs that begin with "<img src=file:"
> versus "<img src=http:"?? iTextSharp will resolve image paths if the path is
> a URL, but all I get is the filename if the source is "file:".
>
> Thanks!
> Shawn
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>
>

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: FW: Calling Assembly from ASP

by Shawn Davies :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'll give this a try, Joe - Thanks!

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: Joe Lynds [mailto:jl@...]
Sent: Tuesday, June 09, 2009 6:19 AM
To: Post all your questions about iTextSharp here
Subject: Re: [itextsharp-questions] FW: Calling Assembly from ASP

Hi, Shawn--

Here's how I do it:

Dim sArrowFileName As String = "c:\images\mathcoder\r-arrow.gif"
Dim oArrowBitMap As Drawing.Image = Drawing.Image.FromFile(sArrowFileName)
Dim oArrowImage As iTextSharp.text.Image =
Image.GetInstance(oArrowBitMap,
System.Drawing.Imaging.ImageFormat.Gif)
...
...
oDoc.Add(oArrowImage)

Regards,

-Joe

http://www.jlion.com


> ----- Original Message -----
> From: "Shawn Davies" <Shawn.Davies@...>
> To: "Post all your questions about iTextSharp here"
> <itextsharp-questions@...>
> Sent: Monday, June 08, 2009 11:45 PM
> Subject: [itextsharp-questions] FW: Calling Assembly from ASP
>
>
> Any recommendations regarding this?
>
> Thanks,
> Shawn
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>
>
> -----Original Message-----
> From: Shawn Davies
> Sent: Monday, June 08, 2009 2:46 PM
> To: Post all your questions about iTextSharp here
> Subject: RE: [itextsharp-questions] Calling Assembly from ASP
>
> I have a question regarding images and iTextSharp...
>
> Is there a way to get it to resolve URLs that begin with "<img src=file:"
> versus "<img src=http:"?? iTextSharp will resolve image paths if the path is
> a URL, but all I get is the filename if the source is "file:".
>
> Thanks!
> Shawn
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>
>

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: FW: Calling Assembly from ASP

by Shawn Davies :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello All,

I'm successfully adding an image to a pdf document using the following:
        iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance("http://website/folder/some_image.bmp");
      datatable.AddCell(img);

However, when I try to do something like this - I get a corrupted pdf file:
        System.Drawing.Image img = System.Drawing.Image.FromFile("\\servername\foldername\image.bmp");
      iTextSharp.text.Image pdfImg = iTextSharp.text.Image.GetInstance(img, System.Drawing.Imaging.ImageFormat.Bmp);
      datatable.AddCell(pdfImg);

Is there anyone out there successfully using a network path like this? Could this be a security issue?
Thanks!
Shawn

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: Joe Lynds [mailto:jl@...]
Sent: Tuesday, June 09, 2009 6:19 AM
To: Post all your questions about iTextSharp here
Subject: Re: [itextsharp-questions] FW: Calling Assembly from ASP

Hi, Shawn--

Here's how I do it:

Dim sArrowFileName As String = "c:\images\mathcoder\r-arrow.gif"
Dim oArrowBitMap As Drawing.Image = Drawing.Image.FromFile(sArrowFileName)
Dim oArrowImage As iTextSharp.text.Image =
Image.GetInstance(oArrowBitMap,
System.Drawing.Imaging.ImageFormat.Gif)
...
...
oDoc.Add(oArrowImage)

Regards,

-Joe

http://www.jlion.com


> ----- Original Message -----
> From: "Shawn Davies" <Shawn.Davies@...>
> To: "Post all your questions about iTextSharp here"
> <itextsharp-questions@...>
> Sent: Monday, June 08, 2009 11:45 PM
> Subject: [itextsharp-questions] FW: Calling Assembly from ASP
>
>
> Any recommendations regarding this?
>
> Thanks,
> Shawn
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>
>
> -----Original Message-----
> From: Shawn Davies
> Sent: Monday, June 08, 2009 2:46 PM
> To: Post all your questions about iTextSharp here
> Subject: RE: [itextsharp-questions] Calling Assembly from ASP
>
> I have a question regarding images and iTextSharp...
>
> Is there a way to get it to resolve URLs that begin with "<img src=file:"
> versus "<img src=http:"?? iTextSharp will resolve image paths if the path is
> a URL, but all I get is the filename if the source is "file:".
>
> Thanks!
> Shawn
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>
>

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: FW: Calling Assembly from ASP

by William Rickards :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I don't use files on a share like that, I have them in a subdirectory
of my asp.net app.
But I use the GetInstance method, not the fromfile method.
for example:

iTextSharp.text.Image.GetInstance(Server.MapPath(".\images\myimage.bmp"))

Will Rickards



On Wed, Jun 10, 2009 at 11:56 AM, Shawn
Davies<Shawn.Davies@...> wrote:

> Hello All,
>
> I'm successfully adding an image to a pdf document using the following:
>        iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance("http://website/folder/some_image.bmp");
>      datatable.AddCell(img);
>
> However, when I try to do something like this - I get a corrupted pdf file:
>        System.Drawing.Image img = System.Drawing.Image.FromFile("\\servername\foldername\image.bmp");
>      iTextSharp.text.Image pdfImg = iTextSharp.text.Image.GetInstance(img, System.Drawing.Imaging.ImageFormat.Bmp);
>      datatable.AddCell(pdfImg);
>
> Is there anyone out there successfully using a network path like this? Could this be a security issue?
> Thanks!
> Shawn
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>
>
> -----Original Message-----
> From: Joe Lynds [mailto:jl@...]
> Sent: Tuesday, June 09, 2009 6:19 AM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] FW: Calling Assembly from ASP
>
> Hi, Shawn--
>
> Here's how I do it:
>
> Dim sArrowFileName As String = "c:\images\mathcoder\r-arrow.gif"
> Dim oArrowBitMap As Drawing.Image = Drawing.Image.FromFile(sArrowFileName)
> Dim oArrowImage As iTextSharp.text.Image =
> Image.GetInstance(oArrowBitMap,
> System.Drawing.Imaging.ImageFormat.Gif)
> ...
> ...
> oDoc.Add(oArrowImage)
>
> Regards,
>
> -Joe
>
> http://www.jlion.com
>
>
>> ----- Original Message -----
>> From: "Shawn Davies" <Shawn.Davies@...>
>> To: "Post all your questions about iTextSharp here"
>> <itextsharp-questions@...>
>> Sent: Monday, June 08, 2009 11:45 PM
>> Subject: [itextsharp-questions] FW: Calling Assembly from ASP
>>
>>
>> Any recommendations regarding this?
>>
>> Thanks,
>> Shawn
>>
>> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>>
>>
>> -----Original Message-----
>> From: Shawn Davies
>> Sent: Monday, June 08, 2009 2:46 PM
>> To: Post all your questions about iTextSharp here
>> Subject: RE: [itextsharp-questions] Calling Assembly from ASP
>>
>> I have a question regarding images and iTextSharp...
>>
>> Is there a way to get it to resolve URLs that begin with "<img src=file:"
>> versus "<img src=http:"?? iTextSharp will resolve image paths if the path is
>> a URL, but all I get is the filename if the source is "file:".
>>
>> Thanks!
>> Shawn
>>
>> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>>
>>
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> itextsharp-questions mailing list
> itextsharp-questions@...
> https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> itextsharp-questions mailing list
> itextsharp-questions@...
> https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
>

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: FW: Calling Assembly from ASP

by Shawn Davies :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I changed my code to do this:
        iTextSharp.text.Image pdfImg = iTextSharp.text.Image.GetInstance(@"file:\\tul1ibo1\IBOGraphics\bmp\1.bmp");
      datatable.AddCell(pdfImg);

The message I'm getting back from my code is "Logon failure: unknown username or bad password.". It looks like a security issue on my network between servers and accounts.

Thanks!
Shawn

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: William Rickards [mailto:itext@...]
Sent: Wednesday, June 10, 2009 11:13 AM
To: Post all your questions about iTextSharp here
Subject: Re: [itextsharp-questions] FW: Calling Assembly from ASP

Hi,

I don't use files on a share like that, I have them in a subdirectory
of my asp.net app.
But I use the GetInstance method, not the fromfile method.
for example:

iTextSharp.text.Image.GetInstance(Server.MapPath(".\images\myimage.bmp"))

Will Rickards



On Wed, Jun 10, 2009 at 11:56 AM, Shawn
Davies<Shawn.Davies@...> wrote:

> Hello All,
>
> I'm successfully adding an image to a pdf document using the following:
>        iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance("http://website/folder/some_image.bmp");
>      datatable.AddCell(img);
>
> However, when I try to do something like this - I get a corrupted pdf file:
>        System.Drawing.Image img = System.Drawing.Image.FromFile("\\servername\foldername\image.bmp");
>      iTextSharp.text.Image pdfImg = iTextSharp.text.Image.GetInstance(img, System.Drawing.Imaging.ImageFormat.Bmp);
>      datatable.AddCell(pdfImg);
>
> Is there anyone out there successfully using a network path like this? Could this be a security issue?
> Thanks!
> Shawn
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>
>
> -----Original Message-----
> From: Joe Lynds [mailto:jl@...]
> Sent: Tuesday, June 09, 2009 6:19 AM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] FW: Calling Assembly from ASP
>
> Hi, Shawn--
>
> Here's how I do it:
>
> Dim sArrowFileName As String = "c:\images\mathcoder\r-arrow.gif"
> Dim oArrowBitMap As Drawing.Image = Drawing.Image.FromFile(sArrowFileName)
> Dim oArrowImage As iTextSharp.text.Image =
> Image.GetInstance(oArrowBitMap,
> System.Drawing.Imaging.ImageFormat.Gif)
> ...
> ...
> oDoc.Add(oArrowImage)
>
> Regards,
>
> -Joe
>
> http://www.jlion.com
>
>
>> ----- Original Message -----
>> From: "Shawn Davies" <Shawn.Davies@...>
>> To: "Post all your questions about iTextSharp here"
>> <itextsharp-questions@...>
>> Sent: Monday, June 08, 2009 11:45 PM
>> Subject: [itextsharp-questions] FW: Calling Assembly from ASP
>>
>>
>> Any recommendations regarding this?
>>
>> Thanks,
>> Shawn
>>
>> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>>
>>
>> -----Original Message-----
>> From: Shawn Davies
>> Sent: Monday, June 08, 2009 2:46 PM
>> To: Post all your questions about iTextSharp here
>> Subject: RE: [itextsharp-questions] Calling Assembly from ASP
>>
>> I have a question regarding images and iTextSharp...
>>
>> Is there a way to get it to resolve URLs that begin with "<img src=file:"
>> versus "<img src=http:"?? iTextSharp will resolve image paths if the path is
>> a URL, but all I get is the filename if the source is "file:".
>>
>> Thanks!
>> Shawn
>>
>> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>>
>>
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> itextsharp-questions mailing list
> itextsharp-questions@...
> https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> itextsharp-questions mailing list
> itextsharp-questions@...
> https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
>

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: FW: Calling Assembly from ASP

by Shawn Davies :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This was a security issue caused from the dll running under the Network Service account at runtime (instead of the authenticated user). To solve this, I used impersonation within the class that calls itextsharp.

I like this utility, and have been able to use it to save database result-sets to pdf files on the fly. Great work!



Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: Shawn Davies
Sent: Wednesday, June 10, 2009 11:32 AM
To: Post all your questions about iTextSharp here
Subject: RE: [itextsharp-questions] FW: Calling Assembly from ASP

I changed my code to do this:
        iTextSharp.text.Image pdfImg = iTextSharp.text.Image.GetInstance(@"file:\\tul1ibo1\IBOGraphics\bmp\1.bmp");
      datatable.AddCell(pdfImg);

The message I'm getting back from my code is "Logon failure: unknown username or bad password.". It looks like a security issue on my network between servers and accounts.

Thanks!
Shawn

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: William Rickards [mailto:itext@...]
Sent: Wednesday, June 10, 2009 11:13 AM
To: Post all your questions about iTextSharp here
Subject: Re: [itextsharp-questions] FW: Calling Assembly from ASP

Hi,

I don't use files on a share like that, I have them in a subdirectory
of my asp.net app.
But I use the GetInstance method, not the fromfile method.
for example:

iTextSharp.text.Image.GetInstance(Server.MapPath(".\images\myimage.bmp"))

Will Rickards



On Wed, Jun 10, 2009 at 11:56 AM, Shawn
Davies<Shawn.Davies@...> wrote:

> Hello All,
>
> I'm successfully adding an image to a pdf document using the following:
>        iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance("http://website/folder/some_image.bmp");
>      datatable.AddCell(img);
>
> However, when I try to do something like this - I get a corrupted pdf file:
>        System.Drawing.Image img = System.Drawing.Image.FromFile("\\servername\foldername\image.bmp");
>      iTextSharp.text.Image pdfImg = iTextSharp.text.Image.GetInstance(img, System.Drawing.Imaging.ImageFormat.Bmp);
>      datatable.AddCell(pdfImg);
>
> Is there anyone out there successfully using a network path like this? Could this be a security issue?
> Thanks!
> Shawn
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>
>
> -----Original Message-----
> From: Joe Lynds [mailto:jl@...]
> Sent: Tuesday, June 09, 2009 6:19 AM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] FW: Calling Assembly from ASP
>
> Hi, Shawn--
>
> Here's how I do it:
>
> Dim sArrowFileName As String = "c:\images\mathcoder\r-arrow.gif"
> Dim oArrowBitMap As Drawing.Image = Drawing.Image.FromFile(sArrowFileName)
> Dim oArrowImage As iTextSharp.text.Image =
> Image.GetInstance(oArrowBitMap,
> System.Drawing.Imaging.ImageFormat.Gif)
> ...
> ...
> oDoc.Add(oArrowImage)
>
> Regards,
>
> -Joe
>
> http://www.jlion.com
>
>
>> ----- Original Message -----
>> From: "Shawn Davies" <Shawn.Davies@...>
>> To: "Post all your questions about iTextSharp here"
>> <itextsharp-questions@...>
>> Sent: Monday, June 08, 2009 11:45 PM
>> Subject: [itextsharp-questions] FW: Calling Assembly from ASP
>>
>>
>> Any recommendations regarding this?
>>
>> Thanks,
>> Shawn
>>
>> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>>
>>
>> -----Original Message-----
>> From: Shawn Davies
>> Sent: Monday, June 08, 2009 2:46 PM
>> To: Post all your questions about iTextSharp here
>> Subject: RE: [itextsharp-questions] Calling Assembly from ASP
>>
>> I have a question regarding images and iTextSharp...
>>
>> Is there a way to get it to resolve URLs that begin with "<img src=file:"
>> versus "<img src=http:"?? iTextSharp will resolve image paths if the path is
>> a URL, but all I get is the filename if the source is "file:".
>>
>> Thanks!
>> Shawn
>>
>> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>>
>>
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> itextsharp-questions mailing list
> itextsharp-questions@...
> https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> itextsharp-questions mailing list
> itextsharp-questions@...
> https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
>

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Parent Message unknown FW: FW: Calling Assembly from ASP

by Shawn Davies :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This was a security issue caused from the dll running under the Network Service account at runtime (instead of the authenticated user). To solve this, I used impersonation within the class that calls itextsharp.

Thanks!
Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245



-----Original Message-----
From: Shawn Davies
Sent: Wednesday, June 10, 2009 1:28 PM
To: Shawn Davies; Post all your questions about iTextSharp here
Subject: RE: [itextsharp-questions] FW: Calling Assembly from ASP

This was a security issue caused from the dll running under the Network Service account at runtime (instead of the authenticated user). To solve this, I used impersonation within the class that calls itextsharp.

I like this utility, and have been able to use it to save database result-sets to pdf files on the fly. Great work!



Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: Shawn Davies
Sent: Wednesday, June 10, 2009 11:32 AM
To: Post all your questions about iTextSharp here
Subject: RE: [itextsharp-questions] FW: Calling Assembly from ASP

I changed my code to do this:
        iTextSharp.text.Image pdfImg = iTextSharp.text.Image.GetInstance(@"file:\\tul1ibo1\IBOGraphics\bmp\1.bmp");
      datatable.AddCell(pdfImg);

The message I'm getting back from my code is "Logon failure: unknown username or bad password.". It looks like a security issue on my network between servers and accounts.

Thanks!
Shawn

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: William Rickards [mailto:itext@...]
Sent: Wednesday, June 10, 2009 11:13 AM
To: Post all your questions about iTextSharp here
Subject: Re: [itextsharp-questions] FW: Calling Assembly from ASP

Hi,

I don't use files on a share like that, I have them in a subdirectory
of my asp.net app.
But I use the GetInstance method, not the fromfile method.
for example:

iTextSharp.text.Image.GetInstance(Server.MapPath(".\images\myimage.bmp"))

Will Rickards



On Wed, Jun 10, 2009 at 11:56 AM, Shawn
Davies<Shawn.Davies@...> wrote:

> Hello All,
>
> I'm successfully adding an image to a pdf document using the following:
>        iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance("http://website/folder/some_image.bmp");
>      datatable.AddCell(img);
>
> However, when I try to do something like this - I get a corrupted pdf file:
>        System.Drawing.Image img = System.Drawing.Image.FromFile("\\servername\foldername\image.bmp");
>      iTextSharp.text.Image pdfImg = iTextSharp.text.Image.GetInstance(img, System.Drawing.Imaging.ImageFormat.Bmp);
>      datatable.AddCell(pdfImg);
>
> Is there anyone out there successfully using a network path like this? Could this be a security issue?
> Thanks!
> Shawn
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>
>
> -----Original Message-----
> From: Joe Lynds [mailto:jl@...]
> Sent: Tuesday, June 09, 2009 6:19 AM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] FW: Calling Assembly from ASP
>
> Hi, Shawn--
>
> Here's how I do it:
>
> Dim sArrowFileName As String = "c:\images\mathcoder\r-arrow.gif"
> Dim oArrowBitMap As Drawing.Image = Drawing.Image.FromFile(sArrowFileName)
> Dim oArrowImage As iTextSharp.text.Image =
> Image.GetInstance(oArrowBitMap,
> System.Drawing.Imaging.ImageFormat.Gif)
> ...
> ...
> oDoc.Add(oArrowImage)
>
> Regards,
>
> -Joe
>
> http://www.jlion.com
>
>
>> ----- Original Message -----
>> From: "Shawn Davies" <Shawn.Davies@...>
>> To: "Post all your questions about iTextSharp here"
>> <itextsharp-questions@...>
>> Sent: Monday, June 08, 2009 11:45 PM
>> Subject: [itextsharp-questions] FW: Calling Assembly from ASP
>>
>>
>> Any recommendations regarding this?
>>
>> Thanks,
>> Shawn
>>
>> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>>
>>
>> -----Original Message-----
>> From: Shawn Davies
>> Sent: Monday, June 08, 2009 2:46 PM
>> To: Post all your questions about iTextSharp here
>> Subject: RE: [itextsharp-questions] Calling Assembly from ASP
>>
>> I have a question regarding images and iTextSharp...
>>
>> Is there a way to get it to resolve URLs that begin with "<img src=file:"
>> versus "<img src=http:"?? iTextSharp will resolve image paths if the path is
>> a URL, but all I get is the filename if the source is "file:".
>>
>> Thanks!
>> Shawn
>>
>> Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245
>>
>>
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> itextsharp-questions mailing list
> itextsharp-questions@...
> https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> itextsharp-questions mailing list
> itextsharp-questions@...
> https://lists.sourceforge.net/lists/listinfo/itextsharp-questions
>

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: Calling Assembly from ASP

by Shawn Davies :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paulo,

What is significant about the content length? Will I run into a problem if I don't specify the length?

Thanks!
Shawn

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: Paulo Soares [mailto:psoares@...]
Sent: Monday, June 08, 2009 9:17 AM
To: Post all your questions about iTextSharp here
Subject: Re: [itextsharp-questions] Calling Assembly from ASP

Don't forget to set the content length.

Paulo

> -----Original Message-----
> From: Shawn Davies [mailto:Shawn.Davies@...]
> Sent: Monday, June 08, 2009 3:13 PM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] Calling Assembly from ASP
>
> I was finally able to get my class to run and generate a pdf from ASP
> code. Whew!
>
>  
>
> After running regasm, I didn't think I needed them in the GAC
> - so I removed my previous entries. Once I added them back in, it
> started working as designed.
>
>  
>
> I have my development machine updated with the Reader 9, the PDF opens
> fine from ASP code - although I noticed it opens in the browser
> window. When I use the same class to create a PDF from managed code,
> it opens an separate Adobe Reader window containing the output. This
> may be a browser setting.
>
>  
>
> I just tried Adobe 7 and "The file is damaged and could not be
> repaired" from Reader. Any ideas about why? It works fine when calling
> from C# (versus ASP). ???
>
>  
>
> Thanks!
>
> Shawn
>
>  
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax:
> 918-488-4245
>
>  
>
> From: Fabrizio Accatino [mailto:fhtino@...]
> Sent: Monday, June 08, 2009 1:40 AM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] Calling Assembly from ASP
>
>  
>
>  
>
> - give the full exception
>
>  
>
> - place itextsharp dll in the same folder of CustomPdf.CreatePdf dll.  
> And try again.
>
>  
>
>  
>
>    fabrizio
>
>  
>
>  
>
>  
>
> On Fri, Jun 5, 2009 at 10:20 PM, Shawn Davies
> <Shawn.Davies@...> wrote:
>
> Thanks for your response. I used the Framework config tool to change
> the permissions for the Local_Intranet zone to "Full Trust". Same
> results. I would think that if there was a security issue, it would
> have popped-up when the object was instantiated using
> "Server.CreateObject".


Aviso Legal:

Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.



Disclaimer:

This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.




------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: Calling Assembly from ASP

by Paulo Soares-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Internet Explorer likes the content length to be able to open the Acrobat
plugin. Without the content lenght sometimes it work ssometimes it doesn't.

Paulo

----- Original Message -----
From: "Shawn Davies" <Shawn.Davies@...>
To: "Post all your questions about iTextSharp here"
<itextsharp-questions@...>
Sent: Thursday, June 11, 2009 7:53 PM
Subject: Re: [itextsharp-questions] Calling Assembly from ASP


Paulo,

What is significant about the content length? Will I run into a problem if I
don't specify the length?

Thanks!
Shawn

Shawn.Davies@... | Office: 918-488-4052 |  Fax: 918-488-4245


-----Original Message-----
From: Paulo Soares [mailto:psoares@...]
Sent: Monday, June 08, 2009 9:17 AM
To: Post all your questions about iTextSharp here
Subject: Re: [itextsharp-questions] Calling Assembly from ASP

Don't forget to set the content length.

Paulo

> -----Original Message-----
> From: Shawn Davies [mailto:Shawn.Davies@...]
> Sent: Monday, June 08, 2009 3:13 PM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] Calling Assembly from ASP
>
> I was finally able to get my class to run and generate a pdf from ASP
> code. Whew!
>
>
>
> After running regasm, I didn't think I needed them in the GAC
> - so I removed my previous entries. Once I added them back in, it
> started working as designed.
>
>
>
> I have my development machine updated with the Reader 9, the PDF opens
> fine from ASP code - although I noticed it opens in the browser
> window. When I use the same class to create a PDF from managed code,
> it opens an separate Adobe Reader window containing the output. This
> may be a browser setting.
>
>
>
> I just tried Adobe 7 and "The file is damaged and could not be
> repaired" from Reader. Any ideas about why? It works fine when calling
> from C# (versus ASP). ???
>
>
>
> Thanks!
>
> Shawn
>
>
>
> Shawn.Davies@... | Office: 918-488-4052 |  Fax:
> 918-488-4245
>
>
>
> From: Fabrizio Accatino [mailto:fhtino@...]
> Sent: Monday, June 08, 2009 1:40 AM
> To: Post all your questions about iTextSharp here
> Subject: Re: [itextsharp-questions] Calling Assembly from ASP
>
>
>
>
>
> - give the full exception
>
>
>
> - place itextsharp dll in the same folder of CustomPdf.CreatePdf dll.
> And try again.
>
>
>
>
>
>    fabrizio
>
>
>
>
>
>
>
> On Fri, Jun 5, 2009 at 10:20 PM, Shawn Davies
> <Shawn.Davies@...> wrote:
>
> Thanks for your response. I used the Framework config tool to change
> the permissions for the Local_Intranet zone to "Full Trust". Same
> results. I would think that if there was a security issue, it would
> have popped-up when the object was instantiated using
> "Server.CreateObject".


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions