Using Postscript, I am unable to print more than 27 barcodes on a page (I need 36) - barcode

We are a large retail business that uses Postscript for all price tags. I have designed this 36-up page of labels both as landscape and portrait (horizontal and vertical), with completely unique code. But as soon as I get to 27 barcodes, the entire page will not print. So I randomly remove 9 of them (it doesn't matter where from) and the page prints. The problem is that we need 36 barcodes. The sample picture contains a portion of the 8 1/2 x 11" page. The top of each label is a short description, followed by the price, a SKU with a barcode at the bottom.
Price Tag Sheet Sample
The following is the Postscript code that can be run on any Postscript printer. Notice at line 841, the first block of barcoding code is commented out with %%. Uncommenting them causes the page not to print:
%!
%%IncludeFeature: emulation(postscript)
%%IncludeFeature: input(lower)
%%IncludeFeature: output(face-up)
%%EndComments
/font {findfont exch scalefont setfont} bind def
%%========== Column 1.1 ==========
initgraphics
90 rotate
40 -55 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Black Go Type Cover) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(99) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111263638) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í111263638º¿) show
grestore
%%========== Column 1.2 ==========
initgraphics
90 rotate
159.75 -55 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Nba 2K20) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(29) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111712858) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í111712858,¿) show
grestore
%%========== Column 1.3 ==========
initgraphics
90 rotate
279.5 -55 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Xbox Live 12 Month \(2015\)) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(59) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(110063333) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í1100633333¿) show
grestore
%%========== Column 1.4 ==========
initgraphics
90 rotate
399.25 -55 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Xbox Live 3 Month \(2015\)) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(24) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(110063340) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í110063340«¿) show
grestore
%%========== Column 1.5 ==========
initgraphics
90 rotate
519 -55 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Crackdown 3) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(19) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111444012) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í111444012{¿) show
grestore
%%========== Column 1.6 ==========
initgraphics
90 rotate
638.75 -55 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
(32GB Pink iPod Touch 6Th Gen) show
grestore
14 /Helvetica-Bold font
20 -20 moveto
($) show
62 -20 moveto
(99) show
31 -35 moveto
1.25 2.25 scale
(249) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(4828630) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í4828630G¿) show
grestore
%%========== Column 2.1 ==========
initgraphics
90 rotate
40 -142 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Shell Oil $25) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(00) show
36 -35 moveto
1.25 2.25 scale
(25) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(110063058) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í110063058[¿) show
grestore
%%========== Column 2.2 ==========
initgraphics
90 rotate
159.75 -142 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
(Switch Lite Blue Armor Case) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(19) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111742897) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í111742897R¿) show
grestore
%%========== Column 2.3 ==========
initgraphics
90 rotate
279.5 -142 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
(3Doodler Create+ Nozzle Set) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(19) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(112164307) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í112164307O¿) show
grestore
%%========== Column 2.4 ==========
initgraphics
90 rotate
399.25 -142 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Kingdom Hearts:All In One) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(39) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111923573) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í111923573t¿) show
grestore
%%========== Column 2.5 ==========
initgraphics
90 rotate
519 -142 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Tab S6 Lite Cover Blue) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(69) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(112013872) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í112013872Z¿) show
grestore
%%========== Column 2.6 ==========
initgraphics
90 rotate
638.75 -142 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Tab S6 Cover Rose Blush) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(69) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(112013775) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í112013775n¿) show
grestore
%%========== Column 3.1 ==========
initgraphics
90 rotate
40 -229 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Deskjet 3639 All In One) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(39) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111773318) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í111773318t¿) show
grestore
%%========== Column 3.2 ==========
initgraphics
90 rotate
159.75 -229 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( 10" Trolley Speaker) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(69) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111533546) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í111533546l¿) show
grestore
%%========== Column 3.3 ==========
initgraphics
90 rotate
279.5 -229 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
(A4,4GB,32GB,14",Home 10S,Pink) show
grestore
14 /Helvetica-Bold font
20 -20 moveto
($) show
62 -20 moveto
(99) show
31 -35 moveto
1.25 2.25 scale
(199) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111982707) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í111982707δ¿) show
grestore
%%========== Column 3.4 ==========
initgraphics
90 rotate
399.25 -229 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
(Kasa Spot Smart Cam Indoor) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(39) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111712904) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í111712904N¿) show
grestore
%%========== Column 3.5 ==========
initgraphics
90 rotate
519 -229 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Tab S6 Lite S-Pen Rose) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(49) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(112013937) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í112013937n¿) show
grestore
%%========== Column 3.6 ==========
initgraphics
90 rotate
638.75 -229 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( 3Doodler Start Pen Set) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(49) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(112164102) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í112164102{¿) show
grestore
%%========== Column 4.1 ==========
initgraphics
90 rotate
40 -316 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Ally Tw Gunmetal) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(99) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(112103456) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í112103456Q¿) show
grestore
%%========== Column 4.2 ==========
initgraphics
90 rotate
159.75 -316 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
(Funko Pop:Frozen 2 Kristoff) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(10) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111773407) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í111773407j¿) show
grestore
%%========== Column 4.3 ==========
initgraphics
90 rotate
279.5 -316 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
(Symantec Ns Deluxe 5 Device) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(79) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(110063449) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í110063449x¿) show
grestore
%%========== Column 4.4 ==========
initgraphics
90 rotate
399.25 -316 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Pro Controller) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(69) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(110602293) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í110602293P¿) show
grestore
%%========== Column 4.5 ==========
initgraphics
90 rotate
519 -316 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
(A4,4GB,32GB,14",Home 10S,Pink) show
grestore
14 /Helvetica-Bold font
20 -20 moveto
($) show
62 -20 moveto
(99) show
31 -35 moveto
1.25 2.25 scale
(199) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111982707) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í111982707δ¿) show
grestore
%%========== Column 4.6 ==========
initgraphics
90 rotate
638.75 -316 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Xbox Live 3 Month \(2015\)) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(24) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(110063340) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í110063340«¿) show
grestore
%%========== Column 5.1 ==========
initgraphics
90 rotate
40 -403 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Microsoft Windows Gc $25) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(00) show
36 -35 moveto
1.25 2.25 scale
(25) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(110063422) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í110063422\)¿) show
grestore
%%========== Column 5.2 ==========
initgraphics
90 rotate
159.75 -403 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Switch Lite Crystal Case) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(13) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111742668) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í1117426685¿) show
grestore
%%========== Column 5.3 ==========
initgraphics
90 rotate
279.5 -403 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
(Yo-Kai Watch 2:Psychic Specter) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(39) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(110782135) show
/Code128-Regular findfont 46 scalefont setfont
5 -55 moveto
gsave
.6 .2 scale
(í110782135W¿) show
grestore
%%========== Column 5.4 ==========
initgraphics
90 rotate
399.25 -403 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( 7-8" Neoprene Tab Case) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(19) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(4708120) show
%%/Code128-Regular findfont 46 scalefont setfont
%%5 -55 moveto
%%gsave
%%.6 .2 scale
%%(í110782135W¿) show
grestore
%%========== Column 5.5 ==========
initgraphics
90 rotate
519 -403 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
(Wallmount-Wht-Beam \(Bm1Wmww1\)) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(00) show
36 -35 moveto
1.25 2.25 scale
(59) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111202892) show
%%/Code128-Regular findfont 46 scalefont setfont
%%5 -55 moveto
%%gsave
%%.6 .2 scale
%%(í110782135W¿) show
grestore
%%========== Column 5.6 ==========
initgraphics
90 rotate
638.75 -403 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Joy-Con Wheel 2 Pack) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(14) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111382343) show
%%/Code128-Regular findfont 46 scalefont setfont
%%5 -55 moveto
%%gsave
%%.6 .2 scale
%%(í110782135W¿) show
grestore
%%========== Column 6.1 ==========
initgraphics
90 rotate
40 -490 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
(Endgame:Captain America-Funko) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(10) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111742640) show
%%/Code128-Regular findfont 46 scalefont setfont
%%5 -55 moveto
%%gsave
%%.6 .2 scale
%%(í110782135W¿) show
grestore
%%========== Column 6.2 ==========
initgraphics
90 rotate
159.75 -490 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
(Switch Lite Blue Armor Case) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(19) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111742897) show
%%/Code128-Regular findfont 46 scalefont setfont
%%5 -55 moveto
%%gsave
%%.6 .2 scale
%%(í110782135W¿) show
grestore
%%========== Column 6.3 ==========
initgraphics
90 rotate
279.5 -490 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Cvs Pharmacy $25) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(00) show
36 -35 moveto
1.25 2.25 scale
(25) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(3899284) show
%%/Code128-Regular findfont 46 scalefont setfont
%%5 -55 moveto
%%gsave
%%.6 .2 scale
%%(í110782135W¿) show
grestore
%%========== Column 6.4 ==========
initgraphics
90 rotate
399.25 -490 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
(Funko Pop:Michael Jordan Bulls) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(34) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(111773430) show
%%/Code128-Regular findfont 46 scalefont setfont
%%5 -55 moveto
%%gsave
%%.6 .2 scale
%%(í110782135W¿) show
grestore
%%========== Column 6.5 ==========
initgraphics
90 rotate
519 -490 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Indoor HDTV Antenna) show
grestore
14 /Helvetica-Bold font
25 -20 moveto
($) show
60 -20 moveto
(99) show
36 -35 moveto
1.25 2.25 scale
(24) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(110303539) show
%%/Code128-Regular findfont 46 scalefont setfont
%%5 -55 moveto
%%gsave
%%.6 .2 scale
%%(í110782135W¿) show
grestore
%%========== Column 6.6 ==========
initgraphics
90 rotate
638.75 -490 translate
13 /Helvetica font
0 0 moveto
gsave
.5 1 scale
( Google Nest Cam Outdoor) show
grestore
14 /Helvetica-Bold font
20 -20 moveto
($) show
62 -20 moveto
(00) show
31 -35 moveto
1.25 2.25 scale
(199) show
1 1 scale
gsave
8 /Helvetica font
15 -23 moveto
1.25 .5 scale
(110362675) show
%%/Code128-Regular findfont 46 scalefont setfont
%%5 -55 moveto
%%gsave
%%.6 .2 scale
%%(í110782135W¿) show
grestore
showpage

It sounds like a memory issue. You might try adding save ... restore either around each code or around groups of them (like columns maybe).
Also note that calling initgraphics shouldn't be necessary. It is called implicitly at the start of each page. Since you're just doing translate and scale, you can reset by using gsave ... grestore or matrix defaultmatrix setmatrix (although, considering the possible memory issue it would be better to grab the default matrix at the start /default matrix defaultmatrix def and use that to reset default setmatrix).
Also, your font setting code could be simplified to use selectfont, assuming a Level 2 (or higher) PostScript printer. If it's a Level 1 printer, then that doubly implicates a memory issue since garbage collection wasn't added until Level 2.

I haven't looked deeper, but the memory consumption sounds strange.
It might be possible to write a better error reporter, but one thing I found right away is that I can count 107 gsave, but only 71 grestore. Are they all properly paired?

Related

Issue displaying inline SVG as src attribute to <img> tag [duplicate]

This question already has answers here:
SVG data image not working as a background-image in a pseudo element
(4 answers)
Closed last year.
SVG alone works, but not as inline with src attribute to <img> tag.
<img src='data:image/svg+xml;charset=utf-8,<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 9.14453C0 9.60156 0.175781 10.0234 0.492188 10.3398L7.91016 17.7578C8.57812 18.4258 9.66797 18.4258 10.3008 17.7578L17.4727 10.5859C18.1406 9.95312 18.1406 8.86328 17.4727 8.19531L10.0547 0.777344C9.73828 0.460938 9.31641 0.25 8.85938 0.25H1.6875C0.738281 0.25 0 1.02344 0 1.9375V9.14453ZM3.9375 2.5C4.85156 2.5 5.625 3.27344 5.625 4.1875C5.625 5.13672 4.85156 5.875 3.9375 5.875C2.98828 5.875 2.25 5.13672 2.25 4.1875C2.25 3.27344 2.98828 2.5 3.9375 2.5Z" fill="#D40026"/></svg>'/>
You have to escape all characters that can be used in a URI
In modern browsers you only need to escape the # character in SVG
That means #D40026 needs to become %23D40026
See: https://yoksel.github.io/url-encoder/
<svg width="19" height="19" viewBox="0 0 190 190" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 91C0 96 2 100 5 103L79 178C86 184 97 184 103 178L175 106C181 100 181 89 175 82L101 8C97 5 93 3 89 3H17C7 3 0 10 0 19V91ZM39 25C49 25 56 33 56 42 56 51 49 59 39 59 30 59 23 51 23 42 23 33 30 25 39 25Z"
fill="#D40026"/>
</svg>
<img src='data:image/svg+xml;charset=utf-8,<svg width="19" height="19" viewBox="0 0 190 190" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 91C0 96 2 100 5 103L79 178C86 184 97 184 103 178L175 106C181 100 181 89 175 82L101 8C97 5 93 3 89 3H17C7 3 0 10 0 19V91ZM39 25C49 25 56 33 56 42 56 51 49 59 39 59 30 59 23 51 23 42 23 33 30 25 39 25Z"
fill="firebrick"/></svg>'/>
<img src='data:image/svg+xml;charset=utf-8,<svg width="19" height="19" viewBox="0 0 190 190" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 91C0 96 2 100 5 103L79 178C86 184 97 184 103 178L175 106C181 100 181 89 175 82L101 8C97 5 93 3 89 3H17C7 3 0 10 0 19V91ZM39 25C49 25 56 33 56 42 56 51 49 59 39 59 30 59 23 51 23 42 23 33 30 25 39 25Z"
fill="%23D40026"/></svg>'/>

Is there a way to manually calculate entity total length from a dxf file?

I need total length and width of whole sheet
Like below
Length - 602
width - 938
i checked with DXF file format reference document i didn't got any clue. can anyone knows about this calculation or code.
0
SECTION
2
HEADER
9
$ACADVER
1
AC1024
9
$ACADMAINTVER
70
109
9
$DWGCODEPAGE
3
ANSI_1252
9
$LASTSAVEDBY
1
haresh.patel
9
$INSBASE
10
0.0
20
0.0
30
0.0
9
$EXTMIN
10
-93.00730087511951
20
-51.69399222749615
30
0.0
9
$EXTMAX
10
1072.189249192752
20
688.3170963457955
30
0.0
9
$LIMMIN
10
0.0
20
0.0
9
$LIMMAX
10
12.0
20
9.0
9
$ORTHOMODE
70
1
9
$REGENMODE
70
1
9
$FILLMODE
70
1
9
$QTEXTMODE
70
0
9
$MIRRTEXT
70
1
9
$LTSCALE
40
1.0
9
$ATTMODE
70
1
9
$TEXTSIZE
40
0.2
9
$TRACEWID
40
0.05
9
$TEXTSTYLE
7
Standard
9
$CLAYER
8
0
9
$CELTYPE
6
ByLayer
9
$CECOLOR
62
256
9
$CELTSCALE
40
1.0
9
$DISPSILH
70
0
9
$DIMSCALE
40
1.0
9
$DIMASZ
40
1.0
9
$DIMEXO
40
0.0
9
$DIMDLI
40
0.0
9
$DIMRND
40
0.0
9
$DIMDLE
40
0.0
9
$DIMEXE
40
0.0
9
$DIMTP
40
0.0
9
$DIMTM
40
0.0
9
$DIMTXT
40
8.0
9
$DIMCEN
40
2.5
9
$DIMTSZ
40
0.0
9
$DIMTOL
70
0
9
$DIMLIM
70
0
9
$DIMTIH
70
0
9
$DIMTOH
70
1
9
$DIMSE1
70
0
9
$DIMSE2
70
0
9
$DIMTAD
70
1
9
$DIMZIN
70
8
9
$DIMBLK
1
9
$DIMASO
70
1
9
$DIMSHO
70
1
9
$DIMPOST
1
9
$DIMAPOST
1
9
$DIMALT
70
0
9
$DIMALTD
70
3
9
$DIMALTF
40
0.03937007874016
9
$DIMLFAC
40
1.0
9
$DIMTOFL
70
1
9
$DIMTVP
40
0.0
9
$DIMTIX
70
0
9
$DIMSOXD
70
0
9
$DIMSAH
70
0
9
$DIMBLK1
1
9
$DIMBLK2
1
9
$DIMSTYLE
2
PRAKASHDIM
9
$DIMCLRD
70
2
9
$DIMCLRE
70
2
9
$DIMCLRT
70
4
9
$DIMTFAC
40
1.0
9
$DIMGAP
40
3.0
9
$DIMJUST
70
0
9
$DIMSD1
70
0
9
$DIMSD2
70
0
9
$DIMTOLJ
70
0
9
$DIMTZIN
70
8
9
$DIMALTZ
70
0
9
$DIMALTTZ
70
0
9
$DIMUPT
70
0
9
$DIMDEC
70
1
9
$DIMTDEC
70
2
9
$DIMALTU
70
2
this is only few part of that dxf file entity

Gnuplot using xtic from data but plotting only every 10th

I have a pretty dense data set along the x-axis and plot it using with boxes as histogram. My data table has entries for x axis labels. The x labels are becoming too dense. How do I let's say print only every 10th of them.
plot 'histo.raw' using 3:xtic(2) with boxes lc rgb 'orange' title 'data'
Sample data:
130 " +0.145 -> +0.150" 0 0.00
131 " +0.150 -> +0.155" 0 0.00
132 " +0.155 -> +0.160" 0 0.00
133 " +0.160 -> +0.165" 1 0.00
134 " +0.165 -> +0.170" 2 0.00
135 " +0.170 -> +0.175" 2 0.00
136 " +0.175 -> +0.180" 4 0.00
137 " +0.180 -> +0.185" 9 0.01
138 " +0.185 -> +0.190" 31 0.03
139 " +0.190 -> +0.195" 74 0.07
140 " +0.195 -> +0.200" 114 0.11
141 " +0.200 -> +0.205" 126 0.13
142 " +0.205 -> +0.210" 114 0.11
143 " +0.210 -> +0.215" 120 0.12
144 " +0.215 -> +0.220" 181 0.18
145 " +0.220 -> +0.225" 216 0.22
146 " +0.225 -> +0.230" 367 0.37
147 " +0.230 -> +0.235" 503 0.50
148 " +0.235 -> +0.240" 648 0.65
149 " +0.240 -> +0.245" 788 0.79
150 " +0.245 -> +0.250" 960 0.96
If I do i.e.
set xtics 0,10 in rotate by 90 offset first +0.5,0 right
plot 'histo.raw' using 3 with boxes lc rgb 'orange' title 'data'
I get the desired spaced out labels. But my label text from the data file is gone and just replaced by line count (which I don't want)
Thanks for your feedback.
You can replace the using 3:xtic(2) with an expression that produces a label only if the row number $0 is divisible by 10:
plot 'histo.raw' \
using 3:xtic((int($0) % 10)==0?stringcolumn(2):"") \
with boxes lc rgb 'orange' title 'data'

Discrepancy between classification report and confusion matrix

Maybe I'm reading the classification report or the confusion matrix wrong (or both!), but after having trained my classifier and run on it my test set, I get the following report:
precision recall f1-score support
0 0.71 0.67 0.69 5086
1 0.64 0.54 0.59 2244
2 0.42 0.25 0.31 598
3 0.65 0.22 0.33 262
4 0.53 0.42 0.47 266
5 0.42 0.15 0.22 466
6 0.35 0.25 0.29 227
7 0.07 0.05 0.06 127
8 0.39 0.14 0.21 376
9 0.35 0.25 0.29 167
10 0.25 0.14 0.18 229
avg / total 0.61 0.52 0.55 10048
Which is good and all, but when I create my confusion matrix:
0 1 2 3 4 5 6 7 8 9 10
[[4288 428 80 16 44 58 33 38 47 21 33]
[ 855 1218 54 8 12 17 25 15 15 12 13]
[ 291 72 147 1 12 10 20 2 2 17 24]
[ 173 21 3 57 1 3 0 1 1 1 1]
[ 102 20 4 0 113 0 0 6 4 9 8]
[ 331 40 10 3 7 68 3 0 2 1 1]
[ 104 30 17 0 1 0 56 2 1 10 6]
[ 85 19 4 2 5 0 2 6 4 0 0]
[ 270 29 4 1 6 2 2 7 53 1 1]
[ 63 17 11 0 8 3 14 1 1 42 7]
[ 138 13 19 0 5 2 7 3 6 5 31]]
Am I wrong in assuming, that it has predicted 4288 samples of class label 0 out of a total of 5086, which should result in a recall value of 84.3% (0.843)? But that's not the number the report spits out. The precision seems wrong as well, unless I'm wrong when I calculate the percentage of correct predictions (4288) with the sum of the rest in column 0, which results in 0.563, and not 0.71.
What am I misunderstanding?
It might be worth nothing that I use sklearn's classification_report and confusion_matrix for these.

remove lines with awk when the value is smaller than

Hello I have this input:
10579 5 2.0 5 100 0 20 0 80 0 20 0.72
10586 5 2.0 5 100 0 20 0 40 20 40 1.52
10856 4 3.2 4 100 0 26 0 69 30 0 0.89
11049 6 12.2 6 65 26 48 14 36 49 0 1.43
11041 2 26.0 2 70 37 20 8 43 47 0 1.34
11012 5 3.0 5 90 9 25 0 56 43 0 0.99
11041 5 3.0 5 9 25 0 56 43 0 0.99
11096 6 2.2 6 100 0 26 15 30 53 0 1.42
11194 1 28.0 1 93 6 51 0 3 96 0 0.22
11236 5 2.4 5 0 24 0 41 58 0 0.98
11981 1 10.0 1 50 18 15 0 9 0 90 0.44
12184 5 2.2 5 100 0 22 18 0 54 27 1.44
12482 4 2.5 4 100 0 20 20 0 80 0 0.72
12627 5 2.2 5 100 0 22 18 0 81 0 0.68
I want to remove lines when the column 5 is smaller than 85. I can do that with awk (awk '$5 > 85') but I want to keep lines when $5 is empty (line 7 and 10). So my output will be like this:
10579 5 2.0 5 100 0 20 0 80 0 20 0.72
10586 5 2.0 5 100 0 20 0 40 20 40 1.52
10579 5 2.0 5 100 0 20 0 80 0 20 0.72
10586 5 2.0 5 100 0 20 0 40 20 40 1.52
10856 4 3.2 4 100 0 26 0 69 30 0 0.89
11012 5 3.0 5 90 9 25 0 56 43 0 0.99
11041 5 3.0 5 9 25 0 56 43 0 0.99
11096 6 2.2 6 100 0 26 15 30 53 0 1.42
11194 1 28.0 1 93 6 51 0 3 96 0 0.22
11236 5 2.4 5 0 24 0 41 58 0 0.78
12184 5 2.2 5 100 0 22 18 0 54 27 1.44
12482 4 2.5 4 100 0 20 20 0 80 0 0.72
12627 5 2.2 5 100 0 22 18 0 81 0 0.68
awk '$5 > 85' is removing also those line. Any help? Thanks
you have to set your field delimiter to a single space, otherwise awk wouldn't know which field is missing
$ awk -F' ' '$5>85' file
10579 5 2.0 5 100 0 20 0 80 0 20 0.72
10586 5 2.0 5 100 0 20 0 40 20 40 1.52
10856 4 3.2 4 100 0 26 0 69 30 0 0.89
11012 5 3.0 5 90 9 25 0 56 43 0 0.99
11096 6 2.2 6 100 0 26 15 30 53 0 1.42
11194 1 28.0 1 93 6 51 0 3 96 0 0.22
12184 5 2.2 5 100 0 22 18 0 54 27 1.44
12482 4 2.5 4 100 0 20 20 0 80 0 0.72
12627 5 2.2 5 100 0 22 18 0 81 0 0.68

Resources