1 (edited by oswall 02/06/2012 12:14:55 pm)

Topic: How print invoice in 1/2 letter size page.

Hi,
You can print the invoice in half a page, either letter or A4 for example.
Or change the page type to 8.5 x 5.5
How I can change the invoice to print half a page.
Thanks,

Re: How print invoice in 1/2 letter size page.

I need to use 1/2 page for billing, saving paper.

Re: How print invoice in 1/2 letter size page.

FA is not supporting A5 size, but you add the following in pdf_report.inc line 98:

          case 'A5':
              // Portrait
                if ($orientation == 'P')
              {
                    $this->pageWidth=595;
                  $this->pageHeight=421;
                  if (!isset($margins))
                  {
                      $this->topMargin=40;
                      $this->bottomMargin=30;
                      $this->leftMargin=40;
                      $this->rightMargin=30;
                  }
              }
              // Landscape
              else
              {
                    $this->pageWidth=421;
                  $this->pageHeight=595;
                  if (!isset($margins))
                  {
                      $this->topMargin=30;
                      $this->bottomMargin=30;
                      $this->leftMargin=40;
                      $this->rightMargin=30;
                  }
              }
              break;

And then set this 'A5' size in all the coduments constructor. Look at rep107.php line 67:

        $rep = new FrontReport(_('INVOICE'), "InvoiceBulk", user_pagesize());

Change user_pagesize() to "A5"

I cannot garuantee that this is all you need to change. If you need more adjustment, you can look into /reporting/includes/heading2.inc.

/Joe

Re: How print invoice in 1/2 letter size page.

Hi Joe,
Thanks for your answer.

Since I included the code for setting 'A5' in pdf_report.inc
However I have problems with the syntax to configure page type to A5 in rep107.php
Trying:

$ rep-> user_pagesize ('A5');
$ rep-> user_pagesize = 'A5';
$ rep-> SetPageSize ('A5');
$ rep-> SetPageSize = 'A5';

and does not work. Sorry but I know little FA API.

5 (edited by oswall 02/06/2012 09:37:44 pm)

Re: How print invoice in 1/2 letter size page.

regards,
I managed to resize the page report107.php this:

$ rep = new FrontReport (_ ('INVOICE'), "InvoiceBulk ',' A5 ', 9' L ');

I use it in Landscape, to maintain a width of about 8.5 in.

How I can change the number of the invoice detail lines.
Can be 10 or 12 lines maximum detail so as not to leave the margins.
Thanks,
Oswall

Re: How print invoice in 1/2 letter size page.

The New Page shift should be done automatically, but maybe something needs to be adjusted in header2.inc.
Remember you are on your own here. We normally do not give support about changing FA.

/Joe

Re: How print invoice in 1/2 letter size page.

regards,
Change things in multiple files and work with type 'A5'.
I think it's important to use 1/2 page to print invoices. It is faster and cheaper for the customer (less paper).
If you want, I send the files to be included revize and when you want.
Oswall

Re: How print invoice in 1/2 letter size page.

Sure, please send the files to contributions mailbox. I will look into them in mean time, maybe we can integrate it as an option in any of next releases.

Janusz

Re: How print invoice in 1/2 letter size page.

is there update regarding this request?
as I just upgrade from sql-ledger considering for FA 2.3.13,

any manual for change cust. invoice page size to half paper A4?

thank you

10 (edited by apmuthu 12/26/2012 10:20:25 am)

Re: How print invoice in 1/2 letter size page.

A5 = half of A4

Line 4178 in reporting/includes/Workbook.php states:

Set the paper type. Ex. 1 = US Letter, 9 = A4

Line 1111 of reporting/includes/tcpdf.php has most paper formats listed.

Lines 94-210 of reporting/includes/pdf_report.inc has the currently used values for PDF A4 and Letter sizes - value in mm times 4 - as the smallest resolution available for print. The other values can be taken from the repgen project at sourceforge listed here for completeness:

$p_formate = array("A4"=>"595|842",
        "A3"=>"842|1190",
        "A5"=>"421|595",
        "4A0"=>"4767.87|6740.79",
        "2A0"=>"3370.39|4767.87",
        "A0"=>"2383.94|3370.39",
        "A1"=>"1683.94|3370.39",
        "A2"=>"1190.55|1683.78",
        "A6"=>"297.64|419.53",
        "A7"=>"209.76|297.64",
        "A8"=>"147.40|209.76",
        "A9"=>"104.88|147.40",
        "A10"=>"73.70|104.88",
        "B0"=>"2834.65|4008.19",
        "B1"=>"2004.09|2834.65",
        "B2"=>"1417.32|2004.09",
        "B3"=>"1000.63|1417.32",
        "B4"=>"708.66|1000.63",
        "B5"=>"498.90|708.66",
        "B6"=>"354.33|498.90",
        "B7"=>"249.45|354.33",
        "B8"=>"175.75|249.45",
        "B9"=>"124.72|175.75",
        "B10"=>"87.87|124.72",
        "C0"=>"2599.37|3676.54",
        "C1"=>"1836.85|2599.37",
        "C2"=>"1298.27|1836.85",
        "C3"=>"918.43|1298.27",
        "C4"=>"649.13|918.43",
        "C5"=>"459.21|649.13",
        "C6"=>"323.15|459.21",
        "C7"=>"229.61|323.15",
        "C8"=>"161.57|229.61",
        "C9"=>"113.39|161.57",
        "C10"=>"79.37|113.39",
        "LETTER"=>"612.00|792.00",
        "EXECUTIVE"=>"521.86|756.00",
        "LEGAL"=>"612.00|1008.00",
        "FOLIO"=>"612.00|936.00",
        "RA0"=>"2437.80|3458.27",
        "RA1"=>"1729.13|2437.80",
        "RA2"=>"1218.90|1729.13",
        "RA3"=>"864.57|1218.90",
        "RA4"=>"609.45|864.57",
        "SRA0"=>"2551.18|3628.35",
        "SRA1"=>"1814.17|2551.18",
        "SRA2"=>"1275.59|1814.17",
        "SRA3"=>"907.09|1275.59",
        "SRA4"=>"637.80|907.09"); // Paperformat 

Also have a look at line 66 in reporting/includes/class.pdf.inc.

Re: How print invoice in 1/2 letter size page.

thank you for the quick respose,

dunno about this "Also have a look at line 66 in reporting/includes/class.pdf.inc."

but no success, print inv, page seem like resized, but the content is cut off,
where I can modify for inv pdf format to match with new paper size?

--
I have changed file config.php
$pagesizes              = array("Letter", "A4", "A5"); // default PDF pagesize

and pdf_report.php
                  case 'A5':
                          // Portrait
                          if ($orientation == 'P')
                          {
                                  $this->pageWidth=421;
                                  $this->pageHeight=595;
                                  if (!isset($margins))
                                  {
                                          $this->topMargin=40;
                                          $this->bottomMargin=30;
                                          $this->leftMargin=40;
                                          $this->rightMargin=30;
                                  }
                          }
                          // Landscape
                          else
                          {
                                  $this->pageWidth=595;
                                  $this->pageHeight=421;
                                  if (!isset($margins))
                                  {
                                          $this->topMargin=30;
                                          $this->bottomMargin=30;
                                          $this->leftMargin=40;
                                          $this->rightMargin=30;
                                  }
                          }
                          break;

Re: How print invoice in 1/2 letter size page.

Lines 64-70 of reporting/includes/class.pdf.inc are:

class Cpdf extends FPDI {

    function Cpdf($pageSize='A4', $lang=null, $pageOrientation='P')
    {
        $this->TCPDF($pageOrientation, 'pt', $pageSize);//, $uni, $enc);
        $this->SetLang($lang);
        $this->setPrintHeader(false);

Line 68 shows the declaration of size units as 'pt'.

Also the default $pageSize='A4' which should correctly be overridden by whatever declaration or setting is given at instantiation time. Hence check the various reports as to how a "new Cpdf" instance is created - whether the default isallowed to be assumed or it is passed on properly as a variable.

Lines 104-110 declare the encodings - see if they are an issue as well.

Re: How print invoice in 1/2 letter size page.

Any news about this A5 landscape thing,
I did not manage to make it work yet
Omar

Re: How print invoice in 1/2 letter size page.

I wouldn't bother with A5. Even if I wanted to print the documents in A5 format, I would generate them in A4 and scale the file down either when saving it or (preferably) when it goes to the printer.

Have you looked at the usual tools for pdf and ps manipulation? pdftk, gs and the like?