Skip to content

Commit

Permalink
Merge pull request #553 from unidoc-build/prep-rc-v3.58.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnsth authored May 1, 2024
2 parents bed2bfd + b5a7219 commit f64a5bd
Show file tree
Hide file tree
Showing 63 changed files with 15,988 additions and 15,880 deletions.
865 changes: 433 additions & 432 deletions annotator/annotator.go

Large diffs are not rendered by default.

121 changes: 61 additions & 60 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,98 +10,99 @@
// terms that can be accessed at https://unidoc.io/eula/

// Package common contains common properties used by the subpackages.
package common ;import (_c "fmt";_gb "io";_ff "os";_b "path/filepath";_d "runtime";_g "time";);
package common ;import (_g "fmt";_gc "io";_f "os";_df "path/filepath";_a "runtime";_c "time";);

// Warning does nothing for dummy logger.
func (DummyLogger )Warning (format string ,args ...interface{}){};func _egd (_aga _gc .Writer ,_gff string ,_dga string ,_fg ...interface{}){_ ,_ffc ,_cb ,_bbe :=_a .Caller (3);if !_bbe {_ffc ="\u003f\u003f\u003f";_cb =0;}else {_ffc =_df .Base (_ffc );
};_ca :=_g .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_gff ,_ffc ,_cb )+_dga +"\u000a";_g .Fprintf (_aga ,_ca ,_fg ...);};

// LogLevel is the verbosity level for logging.
type LogLevel int ;func (_cdg ConsoleLogger )output (_bee _gc .Writer ,_afa string ,_edd string ,_gf ...interface{}){_egd (_bee ,_afa ,_edd ,_gf ...);};var ReleasedAt =_c .Date (_aac ,_egc ,_eaa ,_fa ,_gee ,0,0,_c .UTC );

// Info does nothing for dummy logger.
func (DummyLogger )Info (format string ,args ...interface{}){};

// Warning logs warning message.
func (_ab WriterLogger )Warning (format string ,args ...interface{}){if _ab .LogLevel >=LogLevelWarning {_eff :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_ab .logToWriter (_ab .Output ,_eff ,format ,args ...);};};
// Debug does nothing for dummy logger.
func (DummyLogger )Debug (format string ,args ...interface{}){};const _egc =4;var Log Logger =DummyLogger {};const _fa =15;

// NewConsoleLogger creates new console logger.
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};
// Trace logs trace message.
func (_fb ConsoleLogger )Trace (format string ,args ...interface{}){if _fb .LogLevel >=LogLevelTrace {_ba :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_fb .output (_f .Stdout ,_ba ,format ,args ...);};};

// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _gb .Writer )*WriterLogger {_becg :=WriterLogger {Output :writer ,LogLevel :logLevel };return &_becg ;};
// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };const _dgc ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";

// Notice logs notice message.
func (_gcg ConsoleLogger )Notice (format string ,args ...interface{}){if _gcg .LogLevel >=LogLevelNotice {_gd :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_gcg .output (_f .Stdout ,_gd ,format ,args ...);};};

// Notice logs notice message.
func (_fbf WriterLogger )Notice (format string ,args ...interface{}){if _fbf .LogLevel >=LogLevelNotice {_ab :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_fbf .logToWriter (_fbf .Output ,_ab ,format ,args ...);};};

// Trace does nothing for dummy logger.
func (DummyLogger )Trace (format string ,args ...interface{}){};

// Error does nothing for dummy logger.
func (DummyLogger )Error (format string ,args ...interface{}){};func (_ega WriterLogger )logToWriter (_gbf _gb .Writer ,_bb string ,_da string ,_cb ...interface{}){_dg (_gbf ,_bb ,_da ,_cb );};
func (DummyLogger )Error (format string ,args ...interface{}){};

// Info logs info message.
func (_aa ConsoleLogger )Info (format string ,args ...interface{}){if _aa .LogLevel >=LogLevelInfo {_ba :="\u005bI\u004e\u0046\u004f\u005d\u0020";_aa .output (_ff .Stdout ,_ba ,format ,args ...);};};
// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _gc .Writer )*WriterLogger {_bec :=WriterLogger {Output :writer ,LogLevel :logLevel };return &_bec ;};

// Debug logs debug message.
func (_deg WriterLogger )Debug (format string ,args ...interface{}){if _deg .LogLevel >=LogLevelDebug {_cg :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_deg .logToWriter (_deg .Output ,_cg ,format ,args ...);};};const _dc =2024;
func (_db WriterLogger )Debug (format string ,args ...interface{}){if _db .LogLevel >=LogLevelDebug {_ff :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_db .logToWriter (_db .Output ,_ff ,format ,args ...);};};

// Error logs error message.
func (_aaf WriterLogger )Error (format string ,args ...interface{}){if _aaf .LogLevel >=LogLevelError {_cfd :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_aaf .logToWriter (_aaf .Output ,_cfd ,format ,args ...);};};
func (_dc ConsoleLogger )Error (format string ,args ...interface{}){if _dc .LogLevel >=LogLevelError {_ddd :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_dc .output (_f .Stdout ,_ddd ,format ,args ...);};};

// Debug logs debug message.
func (_fff ConsoleLogger )Debug (format string ,args ...interface{}){if _fff .LogLevel >=LogLevelDebug {_af :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_fff .output (_ff .Stdout ,_af ,format ,args ...);};};
func (_cdf ConsoleLogger )Debug (format string ,args ...interface{}){if _cdf .LogLevel >=LogLevelDebug {_ed :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_cdf .output (_f .Stdout ,_ed ,format ,args ...);};};

// Warning logs warning message.
func (_bfd ConsoleLogger )Warning (format string ,args ...interface{}){if _bfd .LogLevel >=LogLevelWarning {_beg :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_bfd .output (_ff .Stdout ,_beg ,format ,args ...);};};func _dg (_afd _gb .Writer ,_ag string ,_bgg string ,_ggd ...interface{}){_ ,_dge ,_eea ,_aag :=_d .Caller (3);
if !_aag {_dge ="\u003f\u003f\u003f";_eea =0;}else {_dge =_b .Base (_dge );};_faf :=_c .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_ag ,_dge ,_eea )+_bgg +"\u000a";_c .Fprintf (_afd ,_faf ,_ggd ...);};
// NewConsoleLogger creates new console logger.
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};

// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_e string ,_a ...interface{});Warning (_ef string ,_ed ...interface{});Notice (_de string ,_bg ...interface{});Info (_dec string ,_be ...interface{});Debug (_ad string ,_eg ...interface{});Trace (_eda string ,_bd ...interface{});
IsLogLevel (_bf LogLevel )bool ;};
// Notice does nothing for dummy logger.
func (DummyLogger )Notice (format string ,args ...interface{}){};const Version ="\u0033\u002e\u0035\u0038\u002e\u0030";const _aac =2024;

// DummyLogger does nothing.
type DummyLogger struct{};

// Notice logs notice message.
func (_gg ConsoleLogger )Notice (format string ,args ...interface{}){if _gg .LogLevel >=LogLevelNotice {_fb :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_gg .output (_ff .Stdout ,_fb ,format ,args ...);};};

// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _gb .Writer ;};var ReleasedAt =_g .Date (_dc ,_dcd ,_agf ,_aba ,_fda ,0,0,_g .UTC );

// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_ae WriterLogger )IsLogLevel (level LogLevel )bool {return _ae .LogLevel >=level };const Version ="\u0033\u002e\u0035\u0037\u002e\u0030";const _fda =30;
// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_de string ,_cg ...interface{});Warning (_b string ,_gg ...interface{});Notice (_e string ,_dd ...interface{});Info (_cd string ,_cda ...interface{});Debug (_eg string ,_be ...interface{});Trace (_ge string ,_ddc ...interface{});
IsLogLevel (_cgd LogLevel )bool ;};

// Info logs info message.
func (_aaa WriterLogger )Info (format string ,args ...interface{}){if _aaa .LogLevel >=LogLevelInfo {_egc :="\u005bI\u004e\u0046\u004f\u005d\u0020";_aaa .logToWriter (_aaa .Output ,_egc ,format ,args ...);};};
// Warning logs warning message.
func (_gb WriterLogger )Warning (format string ,args ...interface{}){if _gb .LogLevel >=LogLevelWarning {_deb :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_gb .logToWriter (_gb .Output ,_deb ,format ,args ...);};};

// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_gf ConsoleLogger )IsLogLevel (level LogLevel )bool {return _gf .LogLevel >=level };
// UtcTimeFormat returns a formatted string describing a UTC timestamp.
func UtcTimeFormat (t _c .Time )string {return t .Format (_dgc )+"\u0020\u0055\u0054\u0043"};

// IsLogLevel returns true from dummy logger.
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };const _agf =16;

// Notice logs notice message.
func (_ggc WriterLogger )Notice (format string ,args ...interface{}){if _ggc .LogLevel >=LogLevelNotice {_aee :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_ggc .logToWriter (_ggc .Output ,_aee ,format ,args ...);};};

// Trace does nothing for dummy logger.
func (DummyLogger )Trace (format string ,args ...interface{}){};

// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};func (_afa ConsoleLogger )output (_bef _gb .Writer ,_adg string ,_bfe string ,_afb ...interface{}){_dg (_bef ,_adg ,_bfe ,_afb ...);};

// LogLevel is the verbosity level for logging.
type LogLevel int ;const _aba =15;
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };

// Trace logs trace message.
func (_gc ConsoleLogger )Trace (format string ,args ...interface{}){if _gc .LogLevel >=LogLevelTrace {_cf :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_gc .output (_ff .Stdout ,_cf ,format ,args ...);};};
func (_dce WriterLogger )Trace (format string ,args ...interface{}){if _dce .LogLevel >=LogLevelTrace {_eag :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_dce .logToWriter (_dce .Output ,_eag ,format ,args ...);};};const (LogLevelTrace LogLevel =5;
LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);

// Warning does nothing for dummy logger.
func (DummyLogger )Warning (format string ,args ...interface{}){};
// Info logs info message.
func (_fbb WriterLogger )Info (format string ,args ...interface{}){if _fbb .LogLevel >=LogLevelInfo {_dg :="\u005bI\u004e\u0046\u004f\u005d\u0020";_fbb .logToWriter (_fbb .Output ,_dg ,format ,args ...);};};

// Debug does nothing for dummy logger.
func (DummyLogger )Debug (format string ,args ...interface{}){};
// Info logs info message.
func (_ef ConsoleLogger )Info (format string ,args ...interface{}){if _ef .LogLevel >=LogLevelInfo {_af :="\u005bI\u004e\u0046\u004f\u005d\u0020";_ef .output (_f .Stdout ,_af ,format ,args ...);};};const _eaa =30;

// Trace logs trace message.
func (_fa WriterLogger )Trace (format string ,args ...interface{}){if _fa .LogLevel >=LogLevelTrace {_ea :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_fa .logToWriter (_fa .Output ,_ea ,format ,args ...);};};
// Warning logs warning message.
func (_ea ConsoleLogger )Warning (format string ,args ...interface{}){if _ea .LogLevel >=LogLevelWarning {_ec :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_ea .output (_f .Stdout ,_ec ,format ,args ...);};};const _gee =30;

// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };const _dcd =4;const _fd ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";
// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _gc .Writer ;};

// Notice does nothing for dummy logger.
func (DummyLogger )Notice (format string ,args ...interface{}){};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);
// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_fd WriterLogger )IsLogLevel (level LogLevel )bool {return _fd .LogLevel >=level };

// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};func (_eac WriterLogger )logToWriter (_abb _gc .Writer ,_fc string ,_egg string ,_bb ...interface{}){_egd (_abb ,_fc ,_egg ,_bb );};

// Error logs error message.
func (_bec ConsoleLogger )Error (format string ,args ...interface{}){if _bec .LogLevel >=LogLevelError {_ee :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_bec .output (_ff .Stdout ,_ee ,format ,args ...);};};var Log Logger =DummyLogger {};
func (_ee WriterLogger )Error (format string ,args ...interface{}){if _ee .LogLevel >=LogLevelError {_ag :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_ee .logToWriter (_ee .Output ,_ag ,format ,args ...);};};

// UtcTimeFormat returns a formatted string describing a UTC timestamp.
func UtcTimeFormat (t _g .Time )string {return t .Format (_fd )+"\u0020\u0055\u0054\u0043"};
// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_gce ConsoleLogger )IsLogLevel (level LogLevel )bool {return _gce .LogLevel >=level };
32 changes: 16 additions & 16 deletions common/license/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@
// terms that can be accessed at https://unidoc.io/eula/

// Package license helps manage commercial licenses and check if they are valid for the version of unipdf used.
package license ;import _d "github.com/unidoc/unipdf/v3/internal/license";
package license ;import _e "github.com/unidoc/unipdf/v3/internal/license";

// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _d .SetLicenseKey (content ,customerName );};

// LicenseKey represents a loaded license key.
type LicenseKey =_d .LicenseKey ;

// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_d .MeteredStatus ,error ){return _d .GetMeteredState ()};
func SetLicenseKey (content string ,customerName string )error {return _e .SetLicenseKey (content ,customerName );};

// SetMeteredKey sets the metered API key required for SaaS operation.
// Document usage is reported periodically for the product to function correctly.
func SetMeteredKey (apiKey string )error {return _d .SetMeteredKey (apiKey )};const (LicenseTierUnlicensed =_d .LicenseTierUnlicensed ;LicenseTierCommunity =_d .LicenseTierCommunity ;LicenseTierIndividual =_d .LicenseTierIndividual ;LicenseTierBusiness =_d .LicenseTierBusiness ;
);
func SetMeteredKey (apiKey string )error {return _e .SetMeteredKey (apiKey )};

// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _d .MakeUnlicensedKey ()};
// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _e .GetLicenseKey ()};

// SetMeteredKeyPersistentCache sets the metered License API Key persistent cache.
// Default value 'true', set to `false` will report the usage immediately to license server,
// this can be used when there's no access to persistent data storage.
func SetMeteredKeyPersistentCache (val bool ){_d .SetMeteredKeyPersistentCache (val )};
func SetMeteredKeyPersistentCache (val bool ){_e .SetMeteredKeyPersistentCache (val )};

// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _d .GetLicenseKey ()};
// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _e .MakeUnlicensedKey ()};const (LicenseTierUnlicensed =_e .LicenseTierUnlicensed ;LicenseTierCommunity =_e .LicenseTierCommunity ;LicenseTierIndividual =_e .LicenseTierIndividual ;LicenseTierBusiness =_e .LicenseTierBusiness ;
);

// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_e .MeteredStatus ,error ){return _e .GetMeteredState ()};

// LicenseKey represents a loaded license key.
type LicenseKey =_e .LicenseKey ;
Loading

0 comments on commit f64a5bd

Please sign in to comment.