Creating a PDF invoice in medium trust environments - a solution

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
So what is the answer for anyone running NC 1.6? Can I make 1.6 run itextSharp run in 1.6 and do this fix, or do I need to get PDFSharp worked out?
13 years ago
I run 1.6 and have switched to ITextSharp and it works just fine on a medium trust host.

I don't have access to my source code at the moment but I will post it here later on today.

BR
Joakim
13 years ago
Alright here goes;

Step one, download the latest source code for ITextSharp from here:
http://sourceforge.net/projects/itextsharp/

Follow these instructions to make it run on Medium trust:
http://instantdevelopment.blogspot.com/2009/10/itextsharp-pdf-rendering-in-medium.html

Then replace PDF helper in nopCommerce (located in Libraries\Nop.BusinessLogic\Utils) with this:
http://www.jockesoft.com/PDFHelper.rar

Don't forget to add a reference to ItextSharp in your project, please also note that this PDFHelper is adapted to fit my needs and you might need to edit it to display the information you want.

This file is for nopCommerce v1.6, it has not been tested on any other version.

BR
Joakim
13 years ago
ok, when I follow the directions for adding [assembly: AllowPartiallyTrustedCallers()]
to AssemblyInfo.cs  in VS 2010, I just keep getting an error and it doesnt compile.
13 years ago
Also, how do I "add a reference to ItextSharp in your project", I'm a complete NOOB to this and I am trying to learn as fast as possible, but I have no idea what files to enter a reference string into when I open the NC 1.6 source code in VS.
13 years ago
I added the line right after:
[assembly: AssemblyCulture("")]
[assembly: AllowPartiallyTrustedCallers()]

Then I re-compiled. I use VS2008 so I have no idea if there is something in VS2010 that causes this, what exact error do you get?

To add a reference, right-click the Nop.BusinessLogic in Visual Studio and select Add Reference, then select the browse tab and select the ItextSharp.dll you just built in the first steps.

BR
Joakim
13 years ago
I have got to ask, I know Andrei is busy, but how hard would it be to re-release 1.6 with this already done for the PDF/invoice issue? The only thing keeping me from opening my two 1.6 stores is this issue and problems with Paypal Standard. I am beyond useless when it comes to building DLL's or compiling code, so having this permanently fixed for those of us on a medium trust hosting provider would be awesome.
Just my two cents
13 years ago
I agree with MWESALES. It would be a great help to have a quick 1.6 update that would do this. I pretty much figure if I can't understand the lingo I probably can't follow the instructions.
13 years ago
jockesoft wrote:
I added the line right after:
[assembly: AssemblyCulture("")]
[assembly: AllowPartiallyTrustedCallers()]

Then I re-compiled. I use VS2008 so I have no idea if there is something in VS2010 that causes this, what exact error do you get?

To add a reference, right-click the Nop.BusinessLogic in Visual Studio and select Add Reference, then select the browse tab and select the ItextSharp.dll you just built in the first steps.

BR
Joakim


Using VS2008, I used the following line in order to get it to compile and work, not sure why it is different than what is used by others:


[assembly: System.Security.AllowPartiallyTrustedCallers]
12 years ago
is there a way to run pdfsharp in medium trust? thanks!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.