Thank you Ben, I believe that you offer the solution for not just Admin pdf invoice printing, but users' pdf as well. I will try your codes to see and learn more. What I have trouble right now is the Company Name in Admin pdf invoice printing. There is something relates to getlocaleresourcestring that can not result to billingcompany or shippingcompany. The pdf invoice give me "pdfinvoice.company" instead of replace it with "Company" name. Is there any thing that I should change to fix it? Thanks
Thanks, Ben. The log indicates that resource string can not be found, just like you point out. Where can I locate and veryfy it. I only see it in pdfhelp.
Ben, Holliday helped me out and I can get the name now. The image I can only pull it out to pdf using the way Holliday showed me. I can not use: doc.Add(Image.GetInstance(Server.MapPath("~/content/images/logo.jpg")));
How can I get the "Server" instance? hope I use the right term. I also can not get "_templateService" instance.
Hope you don't mind explain it to me or show me how to. Thanks
Ben, Holliday helped me out and I can get the name now. The image I can only pull it out to pdf using the way Holliday showed me. I can not use: doc.Add(Image.GetInstance(Server.MapPath("~/content/images/logo.jpg")));
How can I get the "Server" instance? hope I use the right term. I also can not get "_templateService" instance.
Hi Anthony,
As per my post, that code was for another application. The template service doesn't exist in nopCommerce.
Most of the code in the PDFHelper class involves building up the table. My template service along with the HTMLWorker does this work in the example.
However, the end result is that you add these elements to the document:
doc.Add(addressTable);
Regarding the image:
a) make sure that the image exists (you don't have to use the path I posted) b) You will probably need to use HttpContext.Current.Server.MapPath(path to your image) since you are not executing this code within a Page (my example was actually inside an MVC controller action but same difference).