help with PDFHelper.cs

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
HI all

I'm editing     PDFHelper.cs

to give me a neater invoice page. Essentially, what i am trying to acheive is to have the billing address and the shipping address side by side on the page so that there is less blank space at the top of the page and more space for products - so far i've managed to get this together (by trial and error) by using a table (billing address on left col, shipping on right) I had to lose the 'if' clauses but thats not a problem for me however, i'm stuck with two simple things - isn't it always the way?

They are

1)   how to make the font 10pt
2)   all the data is being put in the table cells but I cant figure out how to geat a line break after each line

here is a portion of the code...

// new table cell :  billing info

            // new table cell :  billing info
            tb2.AddCell(new Cell(
                ("Billing Address:") +
                (order.BillingFullName) +
                (order.BillingAddress1) +
                (order.BillingAddress2) +
                (order.BillingStateProvince) +
                (order.BillingCity) +  
                (order.BillingZipPostalCode) +
                (order.ShippingCountry) +
                (order.BillingPhoneNumber) +
                ("fax : " + order.BillingFaxNumber)
                ), 1, 0);

any help would be much appreciated.
14 years ago
i am sorry but where is this PDFhelper.cs
i will see if i can help you
14 years ago
haydie, try the following code; it should be what you are after -billing and shipping address are side by side. I made a few other changes to the file: added store name and a hyperlink to the store URL (uses the settings in  Administration > Configuration > Global Settings > "General" tab), made some text bold, and adjusted the alignment of products table contents. You can set the font size for all elements by changing line 57 (float normalFontSize = 10f;). Line 58 (float largeFontSize = 16f;) allows you to have a different font size for the store name in the header. A few Font declarations using color are included if you want to have the store title or URL in color. If needed, you can include a store address by editing line 90.

This is for version 1.40 and you will have to recompile the solution.

File: Libraries\Nop.BusinessLogic\Utils\PDFHelper.cs

Download code here (Includes modified PDFHelper.cs, readme file, and an example invoice).

.
14 years ago
UPDATE: code removed, see preceding post for download link.

.
14 years ago
Really, really tidy, MB -

can't thank you enough for that.

hayden
13 years ago
Hi all,

I'm just wondering whether anybody could help me on my final issue before going live, Please help.

I've downloaded the pdfhelper.cs from the previous post and copies it into the Controls folder within in my nopcommerce project, but when i rebuild my project using ctrl and F5 in Visual Web Developer 2010 Express. This doesn't seem to be changing the pdf invoice at all.

Am i doing anything wrong?

Cheers
Mark
13 years ago
hi mark,

youneed to select 'build nopcommercesotore'  from the 'build' menu ( I don't know if you can do this in VWDE?)

but if I remember, the post is from a year ago and the code is probably for version 1.4 and won't work in the current version.

When I get a little time, I'll post some code for the current version

In the meantime, you can go live with the store anyway - when you make this change and rebuild the store on your local machine, you will only have to upload businesslogic.dll and all else will be fine :)



- hayden
13 years ago
Haydie,
Thanks for the reply,  I've found out where I've been going wrong just today.  I need VS not VWDE to compile the dlls and I need to download nop 1.8 source code.
I've now downloaded the sourcecode and I've got a free downloaded of VS pro 2010 from dreamspark. Microsoft are giving away software on dreamspark for students.
I just need a few format changes in the PDfhelper, so worry if your busy about uploading a copy. Ill give it a go myself and see how it goes.

Thanks again
Mark
13 years ago
ok - just ask if you have any questions




fyi new project:
http://www.peebles-theroyalburgh.info
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.