jpt13653903 / Gerber2PDF

Gerber to PDF converter
https://sourceforge.net/projects/gerber2pdf/
GNU General Public License v3.0
36 stars 11 forks source link

Different page sizes for each output page #27

Closed jpt13653903 closed 10 months ago

jpt13653903 commented 10 months ago

Paraphrased from an email sent by @JonThe640:

It would be nice if we can choose the pagesize -page_size=extents|A3|A4|letter] for each pdf page separately.

I request this because in the first page, we want to add a signature box automatically by means of a script, but the page should have a standard size (letter or A4). For other pages, the extend option is best because we have larger images.

jpt13653903 commented 10 months ago

I think I'm going to break lots of people's scripts if I change the behaviour of the page_size option...

Would you mind if I keep the page_size option, and add a next_page_size option that does the following:

In other words: if you want the behaviour you want, don't mix the next_page_size and page_size options in the same script. Also, you can't use page_size=extents with next_page_size=A4, because the next_page_size will be overwritten with extents.

jpt13653903 commented 10 months ago

I've changed my mind... I think I've found a way to make the next_ variants override the global options.

jpt13653903 commented 10 months ago

In version 1.10 you can now set up a script similar to:

"Gerber2pdf.exe"                                                     ^
  -nowarnings                                                        ^
  -silentexit                                                        ^
  -page_size=extents                                                 ^
  -output=Output                                                     ^
  -next_page_size=A4                                                 ^
  -combine                                                           ^
    -colour=0,128,0         top_copper.grb                           ^
    -colour=135,157,175,200 top_solder_mask.grb                      ^
    -colour=191,191,0,200   top_silk.grb                             ^
    -colour=255,255,255     drill_file.drl.grb                       ^
    -colour=0,0,0           board_outline.grb                        ^
  -combine -mirror                                                   ^
    -colour=0,128,0         bottom_copper.grb                        ^
    -colour=135,157,175,200 bottom_solder_mask.grb                   ^
    -colour=191,191,0,200   bottom_silk.grb                          ^
    -colour=255,255,255     drill_file.drl.grb                       ^
    -colour=0,0,0           board_outline.grb                        ^
  -combine -nomirror                                                 ^
    -colour=0,128,0         top_copper.grb                           ^
    -colour=135,157,175,200 top_solder_mask.grb                      ^
    -colour=191,191,0,200   top_silk.grb                             ^
    -colour=255,255,255     drill_file.drl.grb                       ^
    -colour=0,0,0           board_outline.grb                        ^
  -mirror                                                            ^
    -colour=0,128,0         bottom_copper.grb                        ^
    -colour=135,157,175,200 bottom_solder_mask.grb                   ^
    -colour=191,191,0,200   bottom_silk.grb                          ^
    -colour=255,255,255     drill_file.drl.grb                       ^
    -colour=0,0,0           board_outline.grb                        ^
  -nomirror -nocombine                                               ^
    top_silk.grb                                                     ^
    bottom_silk.grb                                                  ^
    top_copper.grb                                                   ^
    bottom_copper.grb                                                ^
    top_solder_mask.grb                                              ^
    bottom_solder_mask.grb                                           ^
    drill_file.drl.grb                                               ^
    board_outline.grb

Only the first page will be A4 size. All the others will follow the "global" extents option.

JonThe640 commented 10 months ago

The new version 1.10 work perfectly!!!! Thank you so much John, you are the king!!

jpt13653903 commented 10 months ago

Pleasure. Sorry these updates took so long -- my day-job was CRAZY last year. Hopefully this year will be less chaotic...

JonThe640 commented 10 months ago

no problem, last week, I was on vacation in Mexico.