kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #08065
Re: Plotting/exporting in nanometres, take 2
On 04/30/2012 12:39 PM, Lorenzo Marcantonio wrote:
> On Mon, Apr 30, 2012 at 09:48:55AM -0500, Dick Hollenbeck wrote:
>
>> makepdf.sh ----------------------------------------------------------
>>
>> ps2pdf -sPAPERSIZE=11x17 @ps2pdf.cmd project.pdf
> I use a more brutal:
>
> cat *.ps | ps2pdf14 -sPAPERSIZE=a4 - out.pdf
>
> (sadly the wildcard doesn't get the pages in order... the sheet number in the
> filename would fix that *todo*)
>
> More interestingly, I use this to get a board preview (just before the gerber
> inspection): (I use zsh because it has no issues expanding names with space
> inside, sh or bash user should add the 'necessary' quoting)
>
> --- CUT HERE --- eeplotpcb ----------------------------------------------------
> #!/bin/zsh
> BASE=$(basename $1 .brd)
>
> # Extract the prologue from the drawing
> sed -e '/translate 90 rotate/,$d' $BASE-Drawings.ps
>
> COLOR="1.0 0.8 0.0"
> echo "$COLOR setrgbcolor"
> sed -e '1,/translate 90 rotate/d' -e '/showpage/,$d' -e "s/0 0 0 setrgbcolor/$COLOR setrgbcolor/" $BASE-Mask_Back.ps
>
> COLOR="0.5 0.0 0.0"
> echo "$COLOR setrgbcolor"
> sed -e '1,/translate 90 rotate/d' -e '/showpage/,$d' -e "s/0 0 0 setrgbcolor/$COLOR setrgbcolor/" $BASE-SoldP_Back.ps
>
> COLOR="1.0 0.0 0.0"
> echo "$COLOR setrgbcolor"
> sed -e '1,/translate 90 rotate/d' -e '/showpage/,$d' -e "s/0 0 0 setrgbcolor/$COLOR setrgbcolor/" $BASE-SilkS_Back.ps
>
> # --- and so on ---
>
> COLOR="0.0 0.0 0.0"
> echo "$COLOR setrgbcolor"
> sed -e '1,/translate 90 rotate/d' -e '/showpage/,$d' -e "s/0 0 0 setrgbcolor/$COLOR setrgbcolor/" $BASE-Drawings.ps
>
> # Epilogue
> cat <<EOF
> showpage
> grestore
> %%EOF
> EOF
> --- CUT HERE --- eeplotpcb ----------------------------------------------------
>
> The trick is using sed to isolate the prologue from the body... sadly doesn't
> work with portrait files (it latches on the "translate 90 rotate" line); I
> should look if maybe there is some DSC to add to better handle this. The last sed
> statement is obviously a recolouring tool.
>
>> I am not mistaken, this would make it possible to search within the PDF file for strings then.
> Yes, it should. Also we could get both the advantages (exact typesetting and
> searchability) if we could generate the 'OCR layer' for the PDF reader: an
> hidden layer of text used for searching which is not displayed. No idea on how
> it's done, most probably there is a special postscript incantation to do it
> (like for annotation/links); maybe ghostscript supports it.
>
> As for 'pure' postscript text (say, in Helvetica), single line is almost
> trivial without the overlining... handling it requires 1) generating single
> glyphs using the font metrics or 2) a non trivial postscript routine to format
> it.
>
> Multiline text is going to be a PITA for both DXF and PS (I don't get *why* I can't generate a good MTEXT entity)
You could fib to yourself, the world, and the output, and treat multi-line text as a
sequence of single line text entities.
The only problem with fibbing to yourself, is that you always get caught.
Follow ups
References