2024-09-14 00:10:30 +00:00

131 lines
38 KiB
Go

//
// Copyright 2020 FoxyUtils ehf. All rights reserved.
//
// This is a commercial product and requires a license to operate.
// A trial license can be obtained at https://unidoc.io
//
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
//
// Use of this source code is governed by the UniDoc End User License Agreement
// terms that can be accessed at https://unidoc.io/eula/
package svg ;import (_ca "encoding/xml";_c "fmt";_a "github.com/unidoc/unipdf/v3/common";_ggg "github.com/unidoc/unipdf/v3/contentstream";_fcd "github.com/unidoc/unipdf/v3/contentstream/draw";_gg "github.com/unidoc/unipdf/v3/core";_dc "github.com/unidoc/unipdf/v3/internal/graphic2d";
_fc "github.com/unidoc/unipdf/v3/model";_cac "golang.org/x/net/html/charset";_gb "io";_g "math";_f "os";_d "strconv";_fe "strings";_b "unicode";);func (_bcff *GraphicSVG )ToContentCreator (cc *_ggg .ContentCreator ,res *_fc .PdfPageResources ,scaleX ,scaleY ,translateX ,translateY float64 )*_ggg .ContentCreator {if _bcff .Name =="\u0073\u0076\u0067"{_bcff .SetScaling (scaleX ,scaleY );
cc .Add_cm (1,0,0,1,translateX ,translateY );_bcff .setDefaultScaling (_bcff ._gafd );cc .Add_q ();_bdg :=_g .Max (scaleX ,scaleY );cc .Add_re (_bcff .ViewBox .X *_bdg ,_bcff .ViewBox .Y *_bdg ,_bcff .ViewBox .W *_bdg ,_bcff .ViewBox .H *_bdg );cc .Add_W ();
cc .Add_n ();for _ ,_fbe :=range _bcff .Children {_fbe .ViewBox =_bcff .ViewBox ;_fbe .toContentStream (cc ,res );};cc .Add_Q ();return cc ;};return nil ;};func _ddeg (_dbdc string )(*Path ,error ){_cgca =_eeda ();_decc ,_edg :=_fdc (_cff (_dbdc ));if _edg !=nil {return nil ,_edg ;
};return _fcee (_decc ),nil ;};func (_cae *GraphicSVG )Decode (decoder *_ca .Decoder )error {for {_cdfd ,_abeb :=decoder .Token ();if _cdfd ==nil &&_abeb ==_gb .EOF {break ;};if _abeb !=nil {return _abeb ;};switch _gbcg :=_cdfd .(type ){case _ca .StartElement :_ddg :=_ced (_gbcg );
_dgf :=_ddg .Decode (decoder );if _dgf !=nil {return _dgf ;};_cae .Children =append (_cae .Children ,_ddg );case _ca .CharData :_gcc :=_fe .TrimSpace (string (_gbcg ));if _gcc !=""{_cae .Content =string (_gbcg );};case _ca .EndElement :if _gbcg .Name .Local ==_cae .Name {return nil ;
};};};return nil ;};func ParseFromFile (path string )(*GraphicSVG ,error ){_fgb ,_cbec :=_f .Open (path );if _cbec !=nil {return nil ,_cbec ;};defer _fgb .Close ();return ParseFromStream (_fgb );};type pathParserError struct{_cgge string };func _dgc (_ccga string )(_efag ,_bbdf ,_fdd float64 ){if (len (_ccga )!=4&&len (_ccga )!=7)||_ccga [0]!='#'{_a .Log .Debug ("I\u006ev\u0061\u006c\u0069\u0064\u0020\u0068\u0065\u0078 \u0063\u006f\u0064\u0065: \u0025\u0073",_ccga );
return _efag ,_bbdf ,_fdd ;};var _fga ,_gfcf ,_ecaf int ;if len (_ccga )==4{var _bacf ,_bdfe ,_cgdf int ;_eedd ,_cbbeg :=_c .Sscanf (_ccga ,"\u0023\u0025\u0031\u0078\u0025\u0031\u0078\u0025\u0031\u0078",&_bacf ,&_bdfe ,&_cgdf );if _cbbeg !=nil {_a .Log .Debug ("\u0049\u006e\u0076a\u006c\u0069\u0064\u0020h\u0065\u0078\u0020\u0063\u006f\u0064\u0065:\u0020\u0025\u0073\u002c\u0020\u0065\u0072\u0072\u006f\u0072\u003a\u0020\u0025\u0076",_ccga ,_cbbeg );
return _efag ,_bbdf ,_fdd ;};if _eedd !=3{_a .Log .Debug ("I\u006ev\u0061\u006c\u0069\u0064\u0020\u0068\u0065\u0078 \u0063\u006f\u0064\u0065: \u0025\u0073",_ccga );return _efag ,_bbdf ,_fdd ;};_fga =_bacf *16+_bacf ;_gfcf =_bdfe *16+_bdfe ;_ecaf =_cgdf *16+_cgdf ;
}else {_fgae ,_fgde :=_c .Sscanf (_ccga ,"\u0023\u0025\u0032\u0078\u0025\u0032\u0078\u0025\u0032\u0078",&_fga ,&_gfcf ,&_ecaf );if _fgde !=nil {_a .Log .Debug ("I\u006ev\u0061\u006c\u0069\u0064\u0020\u0068\u0065\u0078 \u0063\u006f\u0064\u0065: \u0025\u0073",_ccga );
return _efag ,_bbdf ,_fdd ;};if _fgae !=3{_a .Log .Debug ("\u0049\u006e\u0076\u0061\u006c\u0069d\u0020\u0068\u0065\u0078\u0020\u0063\u006f\u0064\u0065\u003a\u0020\u0025\u0073,\u0020\u006e\u0020\u0021\u003d\u0020\u0033 \u0028\u0025\u0064\u0029",_ccga ,_fgae );
return _efag ,_bbdf ,_fdd ;};};_eaa :=float64 (_fga )/255.0;_ecb :=float64 (_gfcf )/255.0;_eebcc :=float64 (_ecaf )/255.0;return _eaa ,_ecb ,_eebcc ;};func _fdg (_eeaa string ,_dbdf int )(float64 ,error ){_ggcc ,_efc :=_egg (_eeaa );_bef ,_geaa :=_d .ParseFloat (_ggcc ,_dbdf );
if _geaa !=nil {return 0,_geaa ;};if _bdbgc ,_efa :=_fb [_efc ];_efa {_bef =_bef *_bdbgc ;}else {_bef =_bef *_dd ;};return _bef ,nil ;};func _gfc (_ded []float64 )[]float64 {for _cdg ,_cgdc :=0,len (_ded )-1;_cdg < _cgdc ;_cdg ,_cgdc =_cdg +1,_cgdc -1{_ded [_cdg ],_ded [_cgdc ]=_ded [_cgdc ],_ded [_cdg ];
};return _ded ;};type Command struct{Symbol string ;Params []float64 ;};func ParseFromString (svgStr string )(*GraphicSVG ,error ){return ParseFromStream (_fe .NewReader (svgStr ));};func _fagf ()*GraphicSVGStyle {return &GraphicSVGStyle {FillColor :"\u00230\u0030\u0030\u0030\u0030\u0030",StrokeColor :"",StrokeWidth :0,FillOpacity :1.0};
};type GraphicSVG struct{ViewBox struct{X ,Y ,W ,H float64 ;};Name string ;Attributes map[string ]string ;Children []*GraphicSVG ;Content string ;Style *GraphicSVGStyle ;Width float64 ;Height float64 ;_gafd float64 ;};func _cff (_bab string )[]token {var (_bedf []token ;
_adb string ;);for _ ,_egcb :=range _bab {_bbfb :=string (_egcb );switch {case _cgca .isCommand (_bbfb ):_bedf ,_adb =_bbd (_bedf ,_adb );_bedf =append (_bedf ,token {_bbfb ,true });case _bbfb =="\u002e":if _adb ==""{_adb ="\u0030";};if _fe .Contains (_adb ,_bbfb ){_bedf =append (_bedf ,token {_adb ,false });
_adb ="\u0030";};fallthrough;case _bbfb >="\u0030"&&_bbfb <="\u0039"||_bbfb =="\u0065":_adb +=_bbfb ;case _bbfb =="\u002d":if _fe .HasSuffix (_adb ,"\u0065"){_adb +=_bbfb ;}else {_bedf ,_ =_bbd (_bedf ,_adb );_adb =_bbfb ;};default:_bedf ,_adb =_bbd (_bedf ,_adb );
};};_bedf ,_ =_bbd (_bedf ,_adb );return _bedf ;};func _dbgg (_cbcf string )(float64 ,error ){_cbcf =_fe .TrimSpace (_cbcf );var _aceg float64 ;if _fe .HasSuffix (_cbcf ,"\u0025"){_dgcg ,_bgcd :=_d .ParseFloat (_fe .TrimSuffix (_cbcf ,"\u0025"),64);if _bgcd !=nil {return 0,_bgcd ;
};_aceg =_dgcg /100.0;}else {_cgff ,_egedg :=_d .ParseFloat (_cbcf ,64);if _egedg !=nil {return 0,_egedg ;};_aceg =_cgff ;};return _aceg ,nil ;};func _ced (_dceg _ca .StartElement )*GraphicSVG {_bgae :=&GraphicSVG {};_feb :=make (map[string ]string );for _ ,_gde :=range _dceg .Attr {_feb [_gde .Name .Local ]=_gde .Value ;
};_bgae .Name =_dceg .Name .Local ;_bgae .Attributes =_feb ;_bgae ._gafd =1;if _bgae .Name =="\u0073\u0076\u0067"{_fbg ,_fece :=_gbda (_feb ["\u0076i\u0065\u0077\u0042\u006f\u0078"]);if _fece !=nil {_a .Log .Debug ("\u0055\u006ea\u0062\u006c\u0065\u0020t\u006f\u0020p\u0061\u0072\u0073\u0065\u0020\u0076\u0069\u0065w\u0042\u006f\u0078\u0020\u0061\u0074\u0074\u0072\u0069\u0062\u0075\u0074e\u003a\u0020\u0025\u0076",_fece );
return nil ;};_bgae .ViewBox .X =_fbg [0];_bgae .ViewBox .Y =_fbg [1];_bgae .ViewBox .W =_fbg [2];_bgae .ViewBox .H =_fbg [3];_bgae .Width =_bgae .ViewBox .W ;_bgae .Height =_bgae .ViewBox .H ;if _abee ,_dcc :=_feb ["\u0077\u0069\u0064t\u0068"];_dcc {_gcf ,_dbd :=_fdg (_abee ,64);
if _dbd !=nil {_a .Log .Debug ("U\u006e\u0061\u0062\u006c\u0065\u0020t\u006f\u0020\u0070\u0061\u0072\u0073e\u0020\u0077\u0069\u0064\u0074\u0068\u0020a\u0074\u0074\u0072\u0069\u0062\u0075\u0074\u0065\u003a\u0020%\u0076",_dbd );return nil ;};_bgae .Width =_gcf ;
};if _dba ,_dbb :=_feb ["\u0068\u0065\u0069\u0067\u0068\u0074"];_dbb {_cefd ,_eeg :=_fdg (_dba ,64);if _eeg !=nil {_a .Log .Debug ("\u0055\u006eab\u006c\u0065\u0020t\u006f\u0020\u0070\u0061rse\u0020he\u0069\u0067\u0068\u0074\u0020\u0061\u0074tr\u0069\u0062\u0075\u0074\u0065\u003a\u0020%\u0076",_eeg );
return nil ;};_bgae .Height =_cefd ;};if _bgae .Width > 0&&_bgae .Height > 0{_bgae ._gafd =_bgae .Width /_bgae .ViewBox .W ;};};return _bgae ;};func (_eegb *GraphicSVGStyle )toContentStream (_bafb *_ggg .ContentCreator ,_dcgc *_fc .PdfPageResources ){if _eegb ==nil {return ;
};if _eegb .FillColor !=""{var _faeb ,_bcd ,_cbd float64 ;if _age ,_cdfb :=_dc .ColorMap [_eegb .FillColor ];_cdfb {_daeb ,_ccf ,_bee ,_ :=_age .RGBA ();_faeb ,_bcd ,_cbd =float64 (_daeb ),float64 (_ccf ),float64 (_bee );}else if _fe .HasPrefix (_eegb .FillColor ,"\u0072\u0067\u0062\u0028"){_faeb ,_bcd ,_cbd =_bead (_eegb .FillColor );
}else {_faeb ,_bcd ,_cbd =_dgc (_eegb .FillColor );};_bafb .Add_rg (_faeb ,_bcd ,_cbd );};if _eegb .FillOpacity < 1.0{_caf :=0;_fdfe :=_gg .PdfObjectName (_c .Sprintf ("\u0047\u0053\u0025\u0064",_caf ));for {_ ,_acab :=_dcgc .GetExtGState (_fdfe );if !_acab {break ;
};_caf ++;_fdfe =_gg .PdfObjectName (_c .Sprintf ("\u0047\u0053\u0025\u0064",_caf ));};_feaa :=_gg .MakeDict ();_feaa .Set ("\u0063\u0061",_gg .MakeFloat (_eegb .FillOpacity ));_beg :=_dcgc .AddExtGState (_fdfe ,_gg .MakeIndirectObject (_feaa ));if _beg !=nil {_a .Log .Debug (_beg .Error ());
return ;};_bafb .Add_gs (_fdfe );};if _eegb .StrokeColor !=""{var _deaab ,_eea ,_eca float64 ;if _egc ,_agc :=_dc .ColorMap [_eegb .StrokeColor ];_agc {_bdf ,_efgg ,_abec ,_ :=_egc .RGBA ();_deaab ,_eea ,_eca =float64 (_bdf )/255.0,float64 (_efgg )/255.0,float64 (_abec )/255.0;
}else if _fe .HasPrefix (_eegb .FillColor ,"\u0072\u0067\u0062\u0028"){_deaab ,_eea ,_eca =_bead (_eegb .FillColor );}else {_deaab ,_eea ,_eca =_dgc (_eegb .StrokeColor );};_bafb .Add_RG (_deaab ,_eea ,_eca );};if _eegb .StrokeWidth > 0{_bafb .Add_w (_eegb .StrokeWidth );
};};func (_cegg *Command )compare (_bgaf *Command )bool {if _cegg .Symbol !=_bgaf .Symbol {return false ;};for _gcg ,_agcg :=range _cegg .Params {if _agcg !=_bgaf .Params [_gcg ]{return false ;};};return true ;};func _geff (_bdgc string )(_cffb []float64 ,_egb error ){var _gdd float64 ;
_ada :=0;_fdcg :=true ;for _gdf ,_fbcf :=range _bdgc {if _fbcf =='.'{if _fdcg {_fdcg =false ;continue ;};_gdd ,_egb =_fdg (_bdgc [_ada :_gdf ],64);if _egb !=nil {return ;};_cffb =append (_cffb ,_gdd );_ada =_gdf ;};};_gdd ,_egb =_fdg (_bdgc [_ada :],64);
if _egb !=nil {return ;};_cffb =append (_cffb ,_gdd );return ;};func _bead (_ccgf string )(float64 ,float64 ,float64 ){_dedf :=_fe .TrimPrefix (_ccgf ,"\u0072\u0067\u0062\u0028");_dedf =_fe .TrimSuffix (_dedf ,"\u0029");_fcdf :=_fe .Split (_dedf ,"\u002c");
if len (_fcdf )!=3{_a .Log .Debug ("I\u006e\u0076\u0061\u006c\u0069\u0064 \u0072\u0067\u0062\u0020\u0063\u006fl\u006f\u0072\u0020\u0073\u0070\u0065\u0063i\u0066\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u003a\u0020%\u0073",_ccgf );return 0,0,0;};var _fgbd ,_cadg ,_dbad float64 ;
_fgbd ,_bcba :=_gcfa (_fcdf [0]);if _bcba !=nil {_a .Log .Debug ("I\u006e\u0076\u0061\u006c\u0069\u0064 \u0072\u0067\u0062\u0020\u0063\u006fl\u006f\u0072\u0020\u0073\u0070\u0065\u0063i\u0066\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u003a\u0020%\u0073",_ccgf );
return 0,0,0;};_cadg ,_bcba =_gcfa (_fcdf [1]);if _bcba !=nil {_a .Log .Debug ("I\u006e\u0076\u0061\u006c\u0069\u0064 \u0072\u0067\u0062\u0020\u0063\u006fl\u006f\u0072\u0020\u0073\u0070\u0065\u0063i\u0066\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u003a\u0020%\u0073",_ccgf );
return 0,0,0;};_dbad ,_bcba =_gcfa (_fcdf [2]);if _bcba !=nil {_a .Log .Debug ("I\u006e\u0076\u0061\u006c\u0069\u0064 \u0072\u0067\u0062\u0020\u0063\u006fl\u006f\u0072\u0020\u0073\u0070\u0065\u0063i\u0066\u0069\u0063\u0061\u0074\u0069\u006f\u006e\u003a\u0020%\u0073",_ccgf );
return 0,0,0;};_abdg :=_fgbd /255.0;_daec :=_cadg /255.0;_acaf :=_dbad /255.0;return _abdg ,_daec ,_acaf ;};func (_geg *GraphicSVG )setDefaultScaling (_bea float64 ){_geg ._gafd =_bea ;if _geg .Style !=nil &&_geg .Style .StrokeWidth > 0{_geg .Style .StrokeWidth =_geg .Style .StrokeWidth *_geg ._gafd ;
};for _ ,_bdcc :=range _geg .Children {_bdcc .setDefaultScaling (_bea );};};func _fdc (_egf []token )([]*Command ,error ){var (_gbga []*Command ;_aec []float64 ;);for _gda :=len (_egf )-1;_gda >=0;_gda --{_faba :=_egf [_gda ];if _faba ._edb {_aga :=_cgca ._becb [_fe .ToLower (_faba ._gbg )];
_cbdd :=len (_aec );if _aga ==0&&_cbdd ==0{_cgce :=&Command {Symbol :_faba ._gbg };_gbga =append ([]*Command {_cgce },_gbga ...);}else if _aga !=0&&_cbdd %_aga ==0{_gcga :=_cbdd /_aga ;for _ace :=0;_ace < _gcga ;_ace ++{_geeb :=_faba ._gbg ;if _geeb =="\u006d"&&_ace < _gcga -1{_geeb ="\u006c";
};if _geeb =="\u004d"&&_ace < _gcga -1{_geeb ="\u004c";};_acd :=&Command {_geeb ,_gfc (_aec [:_aga ])};_gbga =append ([]*Command {_acd },_gbga ...);_aec =_aec [_aga :];};}else {_gbea :=pathParserError {"I\u006e\u0063\u006f\u0072\u0072\u0065c\u0074\u0020\u006e\u0075\u006d\u0062e\u0072\u0020\u006f\u0066\u0020\u0070\u0061r\u0061\u006d\u0065\u0074\u0065\u0072\u0073\u0020\u0066\u006fr\u0020"+_faba ._gbg };
return nil ,_gbea ;};}else {_beb ,_begc :=_fdg (_faba ._gbg ,64);if _begc !=nil {return nil ,_begc ;};_aec =append (_aec ,_beb );};};return _gbga ,nil ;};func _fcee (_bff []*Command )*Path {_dcfd :=&Path {};var _aab []*Command ;for _eged ,_cbb :=range _bff {switch _fe .ToLower (_cbb .Symbol ){case _cgca ._dad :if len (_aab )> 0{_dcfd .Subpaths =append (_dcfd .Subpaths ,&Subpath {_aab });
};_aab =[]*Command {_cbb };case _cgca ._fgf :_aab =append (_aab ,_cbb );_dcfd .Subpaths =append (_dcfd .Subpaths ,&Subpath {_aab });_aab =[]*Command {};default:_aab =append (_aab ,_cbb );if len (_bff )==_eged +1{_dcfd .Subpaths =append (_dcfd .Subpaths ,&Subpath {_aab });
};};};return _dcfd ;};func _efg (_gcd *GraphicSVG ,_bbcd *_ggg .ContentCreator ,_gbc *_fc .PdfPageResources ){_bbcd .Add_q ();_gcd .Style .toContentStream (_bbcd ,_gbc );_cgd ,_ebg :=_gbda (_gcd .Attributes ["\u0070\u006f\u0069\u006e\u0074\u0073"]);if _ebg !=nil {_a .Log .Debug ("\u0045\u0052\u0052O\u0052\u0020\u0075\u006e\u0061\u0062\u006c\u0065\u0020\u0074\u006f\u0020\u0070\u0061\u0072\u0073\u0065\u0020\u0070\u006f\u0069\u006e\u0074\u0073\u0020\u0061\u0074\u0074\u0072i\u0062\u0075\u0074\u0065\u003a\u0020\u0025\u0076",_ebg );
return ;};if len (_cgd )%2> 0{_a .Log .Debug ("\u0045\u0052R\u004f\u0052\u0020\u0069n\u0076\u0061l\u0069\u0064\u0020\u0070\u006f\u0069\u006e\u0074s\u0020\u0061\u0074\u0074\u0072\u0069\u0062\u0075\u0074\u0065\u0020\u006ce\u006e\u0067\u0074\u0068");return ;
};for _fdf :=0;_fdf < len (_cgd );{if _fdf ==0{_bbcd .Add_m (_cgd [_fdf ]*_gcd ._gafd ,_cgd [_fdf +1]*_gcd ._gafd );}else {_bbcd .Add_l (_cgd [_fdf ]*_gcd ._gafd ,_cgd [_fdf +1]*_gcd ._gafd );};_fdf +=2;};_bbcd .Add_l (_cgd [0]*_gcd ._gafd ,_cgd [1]*_gcd ._gafd );
_gcd .Style .fillStroke (_bbcd );_bbcd .Add_h ();_bbcd .Add_Q ();};func (_cfa pathParserError )Error ()string {return _cfa ._cgge };type Path struct{Subpaths []*Subpath ;};func _eeda ()commands {var _dec =map[string ]int {"\u006d":2,"\u007a":0,"\u006c":2,"\u0068":1,"\u0076":1,"\u0063":6,"\u0073":4,"\u0071":4,"\u0074":2,"\u0061":7};
var _bcb []string ;for _ceba :=range _dec {_bcb =append (_bcb ,_ceba );};return commands {_bcb ,_dec ,"\u006d","\u007a"};};func (_afg *Path )compare (_gca *Path )bool {if len (_afg .Subpaths )!=len (_gca .Subpaths ){return false ;};for _cdfg ,_cfec :=range _afg .Subpaths {if !_cfec .compare (_gca .Subpaths [_cdfg ]){return false ;
};};return true ;};func (_baa *commands )isCommand (_dag string )bool {for _ ,_cfd :=range _baa ._bgf {if _fe .ToLower (_dag )==_cfd {return true ;};};return false ;};func (_ggbb *GraphicSVG )SetScaling (xFactor ,yFactor float64 ){_abd :=_ggbb .Width /_ggbb .ViewBox .W ;
_fcgd :=_ggbb .Height /_ggbb .ViewBox .H ;_ggbb .setDefaultScaling (_g .Max (_abd ,_fcgd ));for _ ,_gcb :=range _ggbb .Children {_gcb .SetScaling (xFactor ,yFactor );};};func _bg (_af *GraphicSVG ,_de *_ggg .ContentCreator ,_da *_fc .PdfPageResources ){_de .Add_q ();
_af .Style .toContentStream (_de ,_da );_df ,_cb :=_ddeg (_af .Attributes ["\u0064"]);if _cb !=nil {_a .Log .Error ("\u0045R\u0052\u004f\u0052\u003a\u0020\u0025s",_cb .Error ());};var (_dg ,_ggga =0.0,0.0;_deb ,_gc =0.0,0.0;_ae *Command ;);for _ ,_bc :=range _df .Subpaths {for _ ,_ea :=range _bc .Commands {switch _fe .ToLower (_ea .Symbol ){case "\u006d":_deb ,_gc =_ea .Params [0]*_af ._gafd ,_ea .Params [1]*_af ._gafd ;
if !_ea .isAbsolute (){_deb ,_gc =_dg +_deb -_af .ViewBox .X ,_ggga +_gc -_af .ViewBox .Y ;};_de .Add_m (_edfe (_deb ,3),_edfe (_gc ,3));_dg ,_ggga =_deb ,_gc ;case "\u0063":_eab ,_eb ,_aeg ,_dcg ,_cd ,_bf :=_ea .Params [0]*_af ._gafd ,_ea .Params [1]*_af ._gafd ,_ea .Params [2]*_af ._gafd ,_ea .Params [3]*_af ._gafd ,_ea .Params [4]*_af ._gafd ,_ea .Params [5]*_af ._gafd ;
if !_ea .isAbsolute (){_eab ,_eb ,_aeg ,_dcg ,_cd ,_bf =_dg +_eab ,_ggga +_eb ,_dg +_aeg ,_ggga +_dcg ,_dg +_cd ,_ggga +_bf ;};_de .Add_c (_edfe (_eab ,3),_edfe (_eb ,3),_edfe (_aeg ,3),_edfe (_dcg ,3),_edfe (_cd ,3),_edfe (_bf ,3));_dg ,_ggga =_cd ,_bf ;
case "\u0073":_bge ,_fbc ,_cef ,_ddc :=_ea .Params [0]*_af ._gafd ,_ea .Params [1]*_af ._gafd ,_ea .Params [2]*_af ._gafd ,_ea .Params [3]*_af ._gafd ;if !_ea .isAbsolute (){_bge ,_fbc ,_cef ,_ddc =_dg +_bge ,_ggga +_fbc ,_dg +_cef ,_ggga +_ddc ;};_de .Add_c (_edfe (_dg ,3),_edfe (_ggga ,3),_edfe (_bge ,3),_edfe (_fbc ,3),_edfe (_cef ,3),_edfe (_ddc ,3));
_dg ,_ggga =_cef ,_ddc ;case "\u006c":_ag ,_ac :=_ea .Params [0]*_af ._gafd ,_ea .Params [1]*_af ._gafd ;if !_ea .isAbsolute (){_ag ,_ac =_dg +_ag ,_ggga +_ac ;};_de .Add_l (_edfe (_ag ,3),_edfe (_ac ,3));_dg ,_ggga =_ag ,_ac ;case "\u0068":_aa :=_ea .Params [0]*_af ._gafd ;
if !_ea .isAbsolute (){_aa =_dg +_aa ;};_de .Add_l (_edfe (_aa ,3),_edfe (_ggga ,3));_dg =_aa ;case "\u0076":_acf :=_ea .Params [0]*_af ._gafd ;if !_ea .isAbsolute (){_acf =_ggga +_acf ;};_de .Add_l (_edfe (_dg ,3),_edfe (_acf ,3));_ggga =_acf ;case "\u0071":_ged ,_ba ,_agd ,_eg :=_ea .Params [0]*_af ._gafd ,_ea .Params [1]*_af ._gafd ,_ea .Params [2]*_af ._gafd ,_ea .Params [3]*_af ._gafd ;
if !_ea .isAbsolute (){_ged ,_ba ,_agd ,_eg =_dg +_ged ,_ggga +_ba ,_dg +_agd ,_ggga +_eg ;};_gea ,_dcee :=_dc .QuadraticToCubicBezier (_dg ,_ggga ,_ged ,_ba ,_agd ,_eg );_de .Add_c (_edfe (_gea .X ,3),_edfe (_gea .Y ,3),_edfe (_dcee .X ,3),_edfe (_dcee .Y ,3),_edfe (_agd ,3),_edfe (_eg ,3));
_dg ,_ggga =_agd ,_eg ;case "\u0074":var _ggb ,_fbcb _dc .Point ;_fbd ,_afa :=_ea .Params [0]*_af ._gafd ,_ea .Params [1]*_af ._gafd ;if !_ea .isAbsolute (){_fbd ,_afa =_dg +_fbd ,_ggga +_afa ;};if _ae !=nil &&_fe .ToLower (_ae .Symbol )=="\u0071"{_cbc :=_dc .Point {X :_ae .Params [0]*_af ._gafd ,Y :_ae .Params [1]*_af ._gafd };
_ff :=_dc .Point {X :_ae .Params [2]*_af ._gafd ,Y :_ae .Params [3]*_af ._gafd };_db :=_ff .Mul (2.0).Sub (_cbc );_ggb ,_fbcb =_dc .QuadraticToCubicBezier (_dg ,_ggga ,_db .X ,_db .Y ,_fbd ,_afa );};_de .Add_c (_edfe (_ggb .X ,3),_edfe (_ggb .Y ,3),_edfe (_fbcb .X ,3),_edfe (_fbcb .Y ,3),_edfe (_fbd ,3),_edfe (_afa ,3));
_dg ,_ggga =_fbd ,_afa ;case "\u0061":_gf ,_fea :=_ea .Params [0]*_af ._gafd ,_ea .Params [1]*_af ._gafd ;_ceb :=_ea .Params [2];_acb :=_ea .Params [3]> 0;_gd :=_ea .Params [4]> 0;_fae ,_ddd :=_ea .Params [5]*_af ._gafd ,_ea .Params [6]*_af ._gafd ;if !_ea .isAbsolute (){_fae ,_ddd =_dg +_fae ,_ggga +_ddd ;
};_ed :=_dc .EllipseToCubicBeziers (_dg ,_ggga ,_gf ,_fea ,_ceb ,_acb ,_gd ,_fae ,_ddd );for _ ,_fff :=range _ed {_de .Add_c (_edfe (_fff [1].X ,3),_edfe ((_fff [1].Y ),3),_edfe ((_fff [2].X ),3),_edfe ((_fff [2].Y ),3),_edfe ((_fff [3].X ),3),_edfe ((_fff [3].Y ),3));
};_dg ,_ggga =_fae ,_ddd ;case "\u007a":_de .Add_h ();};_ae =_ea ;};};_af .Style .fillStroke (_de );_de .Add_h ();_de .Add_Q ();};type GraphicSVGStyle struct{FillColor string ;StrokeColor string ;StrokeWidth float64 ;FillOpacity float64 ;};func _gbb (_aca *GraphicSVG ,_aaa *_ggg .ContentCreator ,_fcf *_fc .PdfPageResources ){_aaa .Add_q ();
_aca .Style .toContentStream (_aaa ,_fcf );_ebf ,_eda :=_gbda (_aca .Attributes ["\u0070\u006f\u0069\u006e\u0074\u0073"]);if _eda !=nil {_a .Log .Debug ("\u0045\u0052\u0052O\u0052\u0020\u0075\u006e\u0061\u0062\u006c\u0065\u0020\u0074\u006f\u0020\u0070\u0061\u0072\u0073\u0065\u0020\u0070\u006f\u0069\u006e\u0074\u0073\u0020\u0061\u0074\u0074\u0072i\u0062\u0075\u0074\u0065\u003a\u0020\u0025\u0076",_eda );
return ;};if len (_ebf )%2> 0{_a .Log .Debug ("\u0045\u0052R\u004f\u0052\u0020\u0069n\u0076\u0061l\u0069\u0064\u0020\u0070\u006f\u0069\u006e\u0074s\u0020\u0061\u0074\u0074\u0072\u0069\u0062\u0075\u0074\u0065\u0020\u006ce\u006e\u0067\u0074\u0068");return ;
};for _gef :=0;_gef < len (_ebf );{if _gef ==0{_aaa .Add_m (_ebf [_gef ]*_aca ._gafd ,_ebf [_gef +1]*_aca ._gafd );}else {_aaa .Add_l (_ebf [_gef ]*_aca ._gafd ,_ebf [_gef +1]*_aca ._gafd );};_gef +=2;};_aca .Style .fillStroke (_aaa );_aaa .Add_h ();_aaa .Add_Q ();
};type Subpath struct{Commands []*Command ;};func _abe (_eeb string )(*_fc .PdfFont ,error ){_cada ,_aed :=map[string ]_fc .StdFontName {"\u0063o\u0075\u0072\u0069\u0065\u0072":_fc .CourierName ,"\u0063\u006f\u0075r\u0069\u0065\u0072\u002d\u0062\u006f\u006c\u0064":_fc .CourierBoldName ,"\u0063o\u0075r\u0069\u0065\u0072\u002d\u006f\u0062\u006c\u0069\u0071\u0075\u0065":_fc .CourierObliqueName ,"c\u006fu\u0072\u0069\u0065\u0072\u002d\u0062\u006f\u006cd\u002d\u006f\u0062\u006ciq\u0075\u0065":_fc .CourierBoldObliqueName ,"\u0068e\u006c\u0076\u0065\u0074\u0069\u0063a":_fc .HelveticaName ,"\u0068\u0065\u006c\u0076\u0065\u0074\u0069\u0063\u0061-\u0062\u006f\u006c\u0064":_fc .HelveticaBoldName ,"\u0068\u0065\u006c\u0076\u0065\u0074\u0069\u0063\u0061\u002d\u006f\u0062l\u0069\u0071\u0075\u0065":_fc .HelveticaObliqueName ,"\u0068\u0065\u006c\u0076et\u0069\u0063\u0061\u002d\u0062\u006f\u006c\u0064\u002d\u006f\u0062\u006c\u0069\u0071u\u0065":_fc .HelveticaBoldObliqueName ,"\u0073\u0079\u006d\u0062\u006f\u006c":_fc .SymbolName ,"\u007a\u0061\u0070\u0066\u002d\u0064\u0069\u006e\u0067\u0062\u0061\u0074\u0073":_fc .ZapfDingbatsName ,"\u0074\u0069\u006de\u0073":_fc .TimesRomanName ,"\u0074\u0069\u006d\u0065\u0073\u002d\u0062\u006f\u006c\u0064":_fc .TimesBoldName ,"\u0074\u0069\u006de\u0073\u002d\u0069\u0074\u0061\u006c\u0069\u0063":_fc .TimesItalicName ,"\u0074\u0069\u006d\u0065\u0073\u002d\u0062\u006f\u006c\u0064\u002d\u0069t\u0061\u006c\u0069\u0063":_fc .TimesBoldItalicName }[_eeb ];
if !_aed {return nil ,_c .Errorf ("\u0066\u006f\u006e\u0074\u002df\u0061\u006d\u0069\u006c\u0079\u0020\u0025\u0073\u0020\u006e\u006f\u0074\u0020f\u006f\u0075\u006e\u0064\u0020\u0069\u006e\u0020\u0074\u0068\u0065\u0020\u0073\u0074\u0061\u006e\u0064\u0061\u0072\u0064\u0020\u0066\u006f\u006e\u0074\u0073\u0020\u006c\u0069\u0073t",_eeb );
};_bgg ,_eeff :=_fc .NewStandard14Font (_cada );if _eeff !=nil {return nil ,_eeff ;};return _bgg ,nil ;};var (_dce =[]string {"\u0063\u006d","\u006d\u006d","\u0070\u0078","\u0070\u0074"};_fb =map[string ]float64 {"\u0063\u006d":_ge ,"\u006d\u006d":_fa ,"\u0070\u0078":_dd ,"\u0070\u0074":1};
);type token struct{_gbg string ;_edb bool ;};type commands struct{_bgf []string ;_becb map[string ]int ;_dad string ;_fgf string ;};func (_eeab *Command )isAbsolute ()bool {return _eeab .Symbol ==_fe .ToUpper (_eeab .Symbol )};func _ecc (_aac *GraphicSVG ,_eccc *_ggg .ContentCreator ,_bfa *_fc .PdfPageResources ){_eccc .Add_q ();
_aac .Style .toContentStream (_eccc ,_bfa );_cg ,_cc :=_fdg (_aac .Attributes ["\u0063\u0078"],64);if _cc !=nil {_a .Log .Debug ("\u0045\u0072\u0072or\u0020\u0077\u0068\u0069\u006c\u0065\u0020\u0070\u0061r\u0073i\u006eg\u0020`\u0063\u0078\u0060\u0020\u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_cc .Error ());
};_bgc ,_cc :=_fdg (_aac .Attributes ["\u0063\u0079"],64);if _cc !=nil {_a .Log .Debug ("\u0045\u0072\u0072or\u0020\u0077\u0068\u0069\u006c\u0065\u0020\u0070\u0061r\u0073i\u006eg\u0020`\u0063\u0079\u0060\u0020\u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_cc .Error ());
};_cbee ,_cc :=_fdg (_aac .Attributes ["\u0072"],64);if _cc !=nil {_a .Log .Debug ("\u0045\u0072\u0072\u006f\u0072\u0020w\u0068\u0069\u006c\u0065\u0020\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020`\u0072\u0060\u0020\u0076\u0061\u006c\u0075e\u003a\u0020\u0025\u0076",_cc .Error ());
};_fg :=_cbee *_aac ._gafd ;_fgc :=_cbee *_aac ._gafd ;_baf :=_fg *_fcg ;_fca :=_fgc *_fcg ;_dgb :=_fcd .NewCubicBezierPath ();_dgb =_dgb .AppendCurve (_fcd .NewCubicBezierCurve (-_fg ,0,-_fg ,_fca ,-_baf ,_fgc ,0,_fgc ));_dgb =_dgb .AppendCurve (_fcd .NewCubicBezierCurve (0,_fgc ,_baf ,_fgc ,_fg ,_fca ,_fg ,0));
_dgb =_dgb .AppendCurve (_fcd .NewCubicBezierCurve (_fg ,0,_fg ,-_fca ,_baf ,-_fgc ,0,-_fgc ));_dgb =_dgb .AppendCurve (_fcd .NewCubicBezierCurve (0,-_fgc ,-_baf ,-_fgc ,-_fg ,-_fca ,-_fg ,0));_dgb =_dgb .Offset (_cg *_aac ._gafd ,_bgc *_aac ._gafd );if _aac .Style .StrokeWidth > 0{_dgb =_dgb .Offset (_aac .Style .StrokeWidth /2,_aac .Style .StrokeWidth /2);
};_fcd .DrawBezierPathWithCreator (_dgb ,_eccc );_aac .Style .fillStroke (_eccc );_eccc .Add_h ();_eccc .Add_Q ();};func _cfaa (_daae float64 )int {return int (_daae +_g .Copysign (0.5,_daae ))};func _ebe (_bga *GraphicSVG ,_dfgb *_ggg .ContentCreator ,_be *_fc .PdfPageResources ){_dfgb .Add_BT ();
_bfe ,_bd :=_fdg (_bga .Attributes ["\u0078"],64);if _bd !=nil {_a .Log .Debug ("\u0045\u0072\u0072\u006f\u0072\u0020w\u0068\u0069\u006c\u0065\u0020\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020`\u0078\u0060\u0020\u0076\u0061\u006c\u0075e\u003a\u0020\u0025\u0076",_bd .Error ());
};_eag ,_bd :=_fdg (_bga .Attributes ["\u0079"],64);if _bd !=nil {_a .Log .Debug ("\u0045\u0072\u0072\u006f\u0072\u0020w\u0068\u0069\u006c\u0065\u0020\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020`\u0079\u0060\u0020\u0076\u0061\u006c\u0075e\u003a\u0020\u0025\u0076",_bd .Error ());
};_ab :=_bga .Attributes ["\u0066\u0069\u006c\u006c"];var _fce ,_agg ,_acc float64 ;if _ege ,_cgb :=_dc .ColorMap [_ab ];_cgb {_dcf ,_ffd ,_edd ,_ :=_ege .RGBA ();_fce ,_agg ,_acc =float64 (_dcf ),float64 (_ffd ),float64 (_edd );}else if _fe .HasPrefix (_ab ,"\u0072\u0067\u0062\u0028"){_fce ,_agg ,_acc =_bead (_ab );
}else {_fce ,_agg ,_acc =_dgc (_ab );};_dfgb .Add_rg (_fce ,_agg ,_acc );_eccf :=_ga ;if _acg ,_dac :=_bga .Attributes ["\u0066o\u006e\u0074\u002d\u0073\u0069\u007ae"];_dac {_eccf ,_bd =_d .ParseFloat (_acg ,64);if _bd !=nil {_a .Log .Debug ("\u0045\u0072\u0072\u006f\u0072 \u0077\u0068\u0069\u006c\u0065\u0020\u0070\u0061\u0072\u0073\u0069\u006e\u0067 \u0060\u0066\u006f\u006e\u0074\u002d\u0073\u0069\u007a\u0065\u0060\u0020\u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_bd .Error ());
_eccf =_ga ;};};_eefe :=_bga ._gafd *_eccf *_gae /_fd ;_eefc :=_gg .PdfObjectName ("\u0053\u0046\u006fn\u0074");_fcff :=_fc .DefaultFont ();_faga ,_fdb :=_bga .Attributes ["f\u006f\u006e\u0074\u002d\u0066\u0061\u006d\u0069\u006c\u0079"];if _fdb {if _fdbg ,_cbg :=_abe (_faga );
_cbg ==nil {_fcff =_fdbg ;_gfg :=1;for _be .HasFontByName (_eefc ){_eefc =_gg .PdfObjectName ("\u0053\u0046\u006fn\u0074"+_d .Itoa (_gfg ));_gfg ++;};};};_aad :=0.0;_faed ,_fdb :=_bga .Attributes ["t\u0065\u0078\u0074\u002d\u0061\u006e\u0063\u0068\u006f\u0072"];
if _fdb &&_faed !="\u0073\u0074\u0061r\u0074"{var _dea float64 ;for _ ,_afad :=range _bga .Content {_gedf ,_dae :=_fcff .GetRuneMetrics (_afad );if !_dae {_a .Log .Debug ("\u0045\u0052\u0052OR\u003a\u0020\u0075\u006e\u0073\u0075\u0070\u0070\u006fr\u0074e\u0064 \u0072u\u006e\u0065\u0020\u0025\u0076\u0020\u0069\u006e\u0020\u0066\u006f\u006e\u0074",_afad );
};_dea +=_gedf .Wx ;};_dea =_dea *_eefe /1000.0;if _faed =="\u006d\u0069\u0064\u0064\u006c\u0065"{_aad =-_dea /2;}else if _faed =="\u0065\u006e\u0064"{_aad =-_dea ;};};_dfgb .Add_Tm (1,0,0,-1,_bfe *_bga ._gafd +_aad ,_eag *_bga ._gafd );_be .SetFontByName (_eefc ,_fcff .ToPdfObject ());
_dfgb .Add_Tf (_eefc ,_eefe );_ffdc :=_bga .Content ;_ffe :=_gg .MakeString (_ffdc );_dfgb .Add_Tj (*_ffe );_dfgb .Add_ET ();};func _dfg (_cad *GraphicSVG ,_cgc *_ggg .ContentCreator ,_cadc *_fc .PdfPageResources ){_cgc .Add_q ();_cad .Style .toContentStream (_cgc ,_cadc );
_bgcb ,_efgc :=_fdg (_cad .Attributes ["\u0078\u0031"],64);if _efgc !=nil {_a .Log .Debug ("\u0045\u0072\u0072or\u0020\u0077\u0068\u0069\u006c\u0065\u0020\u0070\u0061r\u0073i\u006eg\u0020`\u0063\u0078\u0060\u0020\u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_efgc .Error ());
};_edf ,_efgc :=_fdg (_cad .Attributes ["\u0079\u0031"],64);if _efgc !=nil {_a .Log .Debug ("\u0045\u0072\u0072or\u0020\u0077\u0068\u0069\u006c\u0065\u0020\u0070\u0061r\u0073i\u006eg\u0020`\u0063\u0079\u0060\u0020\u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_efgc .Error ());
};_bbg ,_efgc :=_fdg (_cad .Attributes ["\u0078\u0032"],64);if _efgc !=nil {_a .Log .Debug ("\u0045\u0072\u0072or\u0020\u0077\u0068\u0069\u006c\u0065\u0020\u0070\u0061r\u0073i\u006eg\u0020`\u0072\u0078\u0060\u0020\u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_efgc .Error ());
};_fac ,_efgc :=_fdg (_cad .Attributes ["\u0079\u0032"],64);if _efgc !=nil {_a .Log .Debug ("\u0045\u0072\u0072or\u0020\u0077\u0068\u0069\u006c\u0065\u0020\u0070\u0061r\u0073i\u006eg\u0020`\u0072\u0079\u0060\u0020\u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_efgc .Error ());
};_cgc .Add_m (_bgcb *_cad ._gafd ,_edf *_cad ._gafd );_cgc .Add_l (_bbg *_cad ._gafd ,_fac *_cad ._gafd );_cad .Style .fillStroke (_cgc );_cgc .Add_h ();_cgc .Add_Q ();};func _egg (_dcece string )(_gfgd ,_eeae string ){if _dcece ==""||(_dcece [len (_dcece )-1]>='0'&&_dcece [len (_dcece )-1]<='9'){return _dcece ,"";
};_gfgd =_dcece ;for _ ,_cebf :=range _dce {if _fe .Contains (_gfgd ,_cebf ){_eeae =_cebf ;};_gfgd =_fe .TrimSuffix (_gfgd ,_cebf );};return ;};var _cgca commands ;func _ee (_bgb *GraphicSVG ,_agb *_ggg .ContentCreator ,_ggge *_fc .PdfPageResources ){_agb .Add_q ();
_bgb .Style .toContentStream (_agb ,_ggge );_ffb ,_aea :=_fdg (_bgb .Attributes ["\u0078"],64);if _aea !=nil {_a .Log .Debug ("\u0045\u0072\u0072\u006f\u0072\u0020w\u0068\u0069\u006c\u0065\u0020\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020`\u0078\u0060\u0020\u0076\u0061\u006c\u0075e\u003a\u0020\u0025\u0076",_aea .Error ());
};_ec ,_aea :=_fdg (_bgb .Attributes ["\u0079"],64);if _aea !=nil {_a .Log .Debug ("\u0045\u0072\u0072\u006f\u0072\u0020w\u0068\u0069\u006c\u0065\u0020\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020`\u0079\u0060\u0020\u0076\u0061\u006c\u0075e\u003a\u0020\u0025\u0076",_aea .Error ());
};_eef ,_aea :=_fdg (_bgb .Attributes ["\u0077\u0069\u0064t\u0068"],64);if _aea !=nil {_a .Log .Debug ("\u0045\u0072\u0072o\u0072\u0020\u0077\u0068\u0069\u006c\u0065\u0020\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020\u0073\u0074\u0072\u006f\u006b\u0065\u0020\u0077\u0069\u0064\u0074\u0068\u0020v\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_aea .Error ());
};_cbe ,_aea :=_fdg (_bgb .Attributes ["\u0068\u0065\u0069\u0067\u0068\u0074"],64);if _aea !=nil {_a .Log .Debug ("\u0045\u0072\u0072\u006f\u0072\u0020\u0077h\u0069\u006c\u0065 \u0070\u0061\u0072\u0073i\u006e\u0067\u0020\u0073\u0074\u0072\u006f\u006b\u0065\u0020\u0068\u0065\u0069\u0067\u0068\u0074\u0020\u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_aea .Error ());
};_agb .Add_re (_ffb *_bgb ._gafd ,_ec *_bgb ._gafd ,_eef *_bgb ._gafd ,_cbe *_bgb ._gafd );_bgb .Style .fillStroke (_agb );_agb .Add_Q ();};func ParseFromStream (source _gb .Reader )(*GraphicSVG ,error ){_cfg :=_ca .NewDecoder (source );_cfg .CharsetReader =_cac .NewReaderLabel ;
_aege ,_dga :=_bbf (_cfg );if _dga !=nil {return nil ,_dga ;};if _bfc :=_aege .Decode (_cfg );_bfc !=nil &&_bfc !=_gb .EOF {return nil ,_bfc ;};return _aege ,nil ;};func _edfe (_caca float64 ,_daf int )float64 {_bbcf :=_g .Pow (10,float64 (_daf ));return float64 (_cfaa (_caca *_bbcf ))/_bbcf ;
};func (_gcbf *Subpath )compare (_ecd *Subpath )bool {if len (_gcbf .Commands )!=len (_ecd .Commands ){return false ;};for _fab ,_ggc :=range _gcbf .Commands {if !_ggc .compare (_ecd .Commands [_fab ]){return false ;};};return true ;};func _bb (_ad *GraphicSVG ,_ceg *_ggg .ContentCreator ,_gee *_fc .PdfPageResources ){_ceg .Add_q ();
_ad .Style .toContentStream (_ceg ,_gee );_acfa ,_fde :=_fdg (_ad .Attributes ["\u0063\u0078"],64);if _fde !=nil {_a .Log .Debug ("\u0045\u0072\u0072or\u0020\u0077\u0068\u0069\u006c\u0065\u0020\u0070\u0061r\u0073i\u006eg\u0020`\u0063\u0078\u0060\u0020\u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_fde .Error ());
};_ece ,_fde :=_fdg (_ad .Attributes ["\u0063\u0079"],64);if _fde !=nil {_a .Log .Debug ("\u0045\u0072\u0072or\u0020\u0077\u0068\u0069\u006c\u0065\u0020\u0070\u0061r\u0073i\u006eg\u0020`\u0063\u0079\u0060\u0020\u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_fde .Error ());
};_gaf ,_fde :=_fdg (_ad .Attributes ["\u0072\u0078"],64);if _fde !=nil {_a .Log .Debug ("\u0045\u0072\u0072or\u0020\u0077\u0068\u0069\u006c\u0065\u0020\u0070\u0061r\u0073i\u006eg\u0020`\u0072\u0078\u0060\u0020\u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_fde .Error ());
};_ecf ,_fde :=_fdg (_ad .Attributes ["\u0072\u0079"],64);if _fde !=nil {_a .Log .Debug ("\u0045\u0072\u0072or\u0020\u0077\u0068\u0069\u006c\u0065\u0020\u0070\u0061r\u0073i\u006eg\u0020`\u0072\u0079\u0060\u0020\u0076\u0061\u006c\u0075\u0065\u003a\u0020\u0025\u0076",_fde .Error ());
};_ef :=_gaf *_ad ._gafd ;_bcf :=_ecf *_ad ._gafd ;_dde :=_acfa *_ad ._gafd ;_bbc :=_ece *_ad ._gafd ;_fag :=_ef *_fcg ;_gbe :=_bcf *_fcg ;_ecea :=_fcd .NewCubicBezierPath ();_ecea =_ecea .AppendCurve (_fcd .NewCubicBezierCurve (-_ef ,0,-_ef ,_gbe ,-_fag ,_bcf ,0,_bcf ));
_ecea =_ecea .AppendCurve (_fcd .NewCubicBezierCurve (0,_bcf ,_fag ,_bcf ,_ef ,_gbe ,_ef ,0));_ecea =_ecea .AppendCurve (_fcd .NewCubicBezierCurve (_ef ,0,_ef ,-_gbe ,_fag ,-_bcf ,0,-_bcf ));_ecea =_ecea .AppendCurve (_fcd .NewCubicBezierCurve (0,-_bcf ,-_fag ,-_bcf ,-_ef ,-_gbe ,-_ef ,0));
_ecea =_ecea .Offset (_dde ,_bbc );if _ad .Style .StrokeWidth > 0{_ecea =_ecea .Offset (_ad .Style .StrokeWidth /2,_ad .Style .StrokeWidth /2);};_fcd .DrawBezierPathWithCreator (_ecea ,_ceg );_ad .Style .fillStroke (_ceg );_ceg .Add_h ();_ceg .Add_Q ();
};func _gcfa (_geebf string )(float64 ,error ){_geebf =_fe .TrimSpace (_geebf );var _efgb float64 ;if _fe .HasSuffix (_geebf ,"\u0025"){_bedd ,_gac :=_d .ParseFloat (_fe .TrimSuffix (_geebf ,"\u0025"),64);if _gac !=nil {return 0,_gac ;};_efgb =(_bedd *255.0)/100.0;
}else {_aba ,_cggb :=_d .Atoi (_geebf );if _cggb !=nil {return 0,_cggb ;};_efgb =float64 (_aba );};return _efgb ,nil ;};func (_dbg *GraphicSVG )toContentStream (_cee *_ggg .ContentCreator ,_gfe *_fc .PdfPageResources ){_cf ,_cdfdf :=_ebee (_dbg .Attributes ,_dbg ._gafd );
if _cdfdf !=nil {_a .Log .Debug ("U\u006e\u0061\u0062\u006c\u0065\u0020t\u006f\u0020\u0070\u0061\u0072\u0073e\u0020\u0073\u0074\u0079\u006c\u0065\u0020a\u0074\u0074\u0072\u0069\u0062\u0075\u0074\u0065\u003a\u0020%\u0076",_cdfdf );};_dbg .Style =_cf ;switch _dbg .Name {case "\u0070\u0061\u0074\u0068":_bg (_dbg ,_cee ,_gfe );
for _ ,_cfe :=range _dbg .Children {_cfe .toContentStream (_cee ,_gfe );};case "\u0072\u0065\u0063\u0074":_ee (_dbg ,_cee ,_gfe );for _ ,_dgd :=range _dbg .Children {_dgd .toContentStream (_cee ,_gfe );};case "\u0063\u0069\u0072\u0063\u006c\u0065":_ecc (_dbg ,_cee ,_gfe );
for _ ,_cga :=range _dbg .Children {_cga .toContentStream (_cee ,_gfe );};case "\u0065l\u006c\u0069\u0070\u0073\u0065":_bb (_dbg ,_cee ,_gfe );for _ ,_eaf :=range _dbg .Children {_eaf .toContentStream (_cee ,_gfe );};case "\u0070\u006f\u006c\u0079\u006c\u0069\u006e\u0065":_gbb (_dbg ,_cee ,_gfe );
for _ ,_gafc :=range _dbg .Children {_gafc .toContentStream (_cee ,_gfe );};case "\u0070o\u006c\u0079\u0067\u006f\u006e":_efg (_dbg ,_cee ,_gfe );for _ ,_dgg :=range _dbg .Children {_dgg .toContentStream (_cee ,_gfe );};case "\u006c\u0069\u006e\u0065":_dfg (_dbg ,_cee ,_gfe );
for _ ,_fec :=range _dbg .Children {_fec .toContentStream (_cee ,_gfe );};case "\u0074\u0065\u0078\u0074":_ebe (_dbg ,_cee ,_gfe );for _ ,_bda :=range _dbg .Children {_bda .toContentStream (_cee ,_gfe );};case "\u0067":_cda ,_bcc :=_dbg .Attributes ["\u0066\u0069\u006c\u006c"];
_eae ,_eed :=_dbg .Attributes ["\u0073\u0074\u0072\u006f\u006b\u0065"];_dcfc ,_dgdb :=_dbg .Attributes ["\u0073\u0074\u0072o\u006b\u0065\u002d\u0077\u0069\u0064\u0074\u0068"];for _ ,_deaa :=range _dbg .Children {if _ ,_gafb :=_deaa .Attributes ["\u0066\u0069\u006c\u006c"];
!_gafb &&_bcc {_deaa .Attributes ["\u0066\u0069\u006c\u006c"]=_cda ;};if _ ,_cbf :=_deaa .Attributes ["\u0073\u0074\u0072\u006f\u006b\u0065"];!_cbf &&_eed {_deaa .Attributes ["\u0073\u0074\u0072\u006f\u006b\u0065"]=_eae ;};if _ ,_bdb :=_deaa .Attributes ["\u0073\u0074\u0072o\u006b\u0065\u002d\u0077\u0069\u0064\u0074\u0068"];
!_bdb &&_dgdb {_deaa .Attributes ["\u0073\u0074\u0072o\u006b\u0065\u002d\u0077\u0069\u0064\u0074\u0068"]=_dcfc ;};_deaa .toContentStream (_cee ,_gfe );};};};func _bbf (_abg *_ca .Decoder )(*GraphicSVG ,error ){for {_dbaf ,_dcge :=_abg .Token ();if _dbaf ==nil &&_dcge ==_gb .EOF {break ;
};if _dcge !=nil {return nil ,_dcge ;};switch _aaab :=_dbaf .(type ){case _ca .StartElement :return _ced (_aaab ),nil ;};};return &GraphicSVG {},nil ;};const (_dd =0.72;_ge =28.3464;_fa =_ge /10;_fcg =0.551784;_fd =96;_ga =16.0;_gae float64 =72;);func (_gede *GraphicSVGStyle )fillStroke (_efd *_ggg .ContentCreator ){if _gede .FillColor !=""&&_gede .StrokeColor !=""{_efd .Add_B ();
}else if _gede .FillColor !=""{_efd .Add_f ();}else if _gede .StrokeColor !=""{_efd .Add_S ();};};func _gbda (_dfc string )([]float64 ,error ){_ccg :=-1;var _ceff []float64 ;_cbca :=' ';for _agda ,_fbcbc :=range _dfc {if !_b .IsNumber (_fbcbc )&&_fbcbc !='.'&&!(_fbcbc =='-'&&_cbca =='e')&&_fbcbc !='e'{if _ccg !=-1{_bdcd ,_gbf :=_geff (_dfc [_ccg :_agda ]);
if _gbf !=nil {return _ceff ,_gbf ;};_ceff =append (_ceff ,_bdcd ...);};if _fbcbc =='-'{_ccg =_agda ;}else {_ccg =-1;};}else if _ccg ==-1{_ccg =_agda ;};_cbca =_fbcbc ;};if _ccg !=-1&&_ccg !=len (_dfc ){_dgbg ,_cbbe :=_geff (_dfc [_ccg :]);if _cbbe !=nil {return _ceff ,_cbbe ;
};_ceff =append (_ceff ,_dgbg ...);};return _ceff ,nil ;};func _ebee (_gccf map[string ]string ,_eec float64 )(*GraphicSVGStyle ,error ){_bgcbb :=_fagf ();_feae ,_ffa :=_gccf ["\u0066\u0069\u006c\u006c"];if _ffa {_bgcbb .FillColor =_feae ;if _feae =="\u006e\u006f\u006e\u0065"{_bgcbb .FillColor ="";
};};_dfd ,_cfc :=_gccf ["\u0066\u0069\u006cl\u002d\u006f\u0070\u0061\u0063\u0069\u0074\u0079"];if _cfc {_gbd ,_ddee :=_dbgg (_dfd );if _ddee !=nil {return nil ,_ddee ;};_bgcbb .FillOpacity =_gbd ;};_cde ,_gbae :=_gccf ["\u0073\u0074\u0072\u006f\u006b\u0065"];
if _gbae {_bgcbb .StrokeColor =_cde ;if _cde =="\u006e\u006f\u006e\u0065"{_bgcbb .StrokeColor ="";};};_cgg ,_adf :=_gccf ["\u0073\u0074\u0072o\u006b\u0065\u002d\u0077\u0069\u0064\u0074\u0068"];if _adf {_fecg ,_bed :=_fdg (_cgg ,64);if _bed !=nil {return nil ,_bed ;
};_bgcbb .StrokeWidth =_fecg *_eec ;};return _bgcbb ,nil ;};func _bbd (_daa []token ,_bdbg string )([]token ,string ){if _bdbg !=""{_daa =append (_daa ,token {_bdbg ,false });_bdbg ="";};return _daa ,_bdbg ;};