How to have a logo on the PDF invoice?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
I was wondering whether or not it is possible to have logo on the Pdf invoices?

Looking at this piece of code, it would appear possible:


PdfService.cs

  //logo
                var logoPicture = _pictureService.GetPictureById(_pdfSettings.LogoPictureId);
                var logoExists = logoPicture != null;

                //header
                var headerTable = new PdfPTable(logoExists ? 2 : 1);
                headerTable.WidthPercentage = 100f;
                if (logoExists)
                    headerTable.SetWidths(new[] { 50, 50 });

                //logo
                if (logoExists)
                {
                    var logoFilePath = _pictureService.GetPictureLocalPath(logoPicture, 0, false);
                    var cellLogo = new PdfPCell(Image.GetInstance(logoFilePath));
                    cellLogo.Border = Rectangle.NO_BORDER;
                    headerTable.AddCell(cellLogo);

Printing on headed paper is an obvious alternative, however including a logo on invoices would be cheaper.

Also is it possible to have the long description instead of the short.
11 years ago
You can upload the PDF logo in admin>configuration>settings>general and miscelaneous settings>pdf settings tab (example in admin demo)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.