Skip to content

Commit

Permalink
Merge pull request #544 from unidoc-build/prep-rc-v3.54.0
Browse files Browse the repository at this point in the history
Release v3.54.0
  • Loading branch information
gunnsth authored Jan 22, 2024
2 parents 4885ab0 + a8fa52b commit 713619f
Show file tree
Hide file tree
Showing 65 changed files with 15,721 additions and 15,657 deletions.
771 changes: 427 additions & 344 deletions annotator/annotator.go

Large diffs are not rendered by default.

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

// Package common contains common properties used by the subpackages.
package common ;import (_e "fmt";_b "io";_ee "os";_g "path/filepath";_c "runtime";_d "time";);const Version ="\u0033\u002e\u0035\u0033\u002e\u0030";var Log Logger =DummyLogger {};
package common ;import (_c "fmt";_cb "io";_eg "os";_ca "path/filepath";_ec "runtime";_e "time";);

// Trace logs trace message.
func (_dddf WriterLogger )Trace (format string ,args ...interface{}){if _dddf .LogLevel >=LogLevelTrace {_ce :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_dddf .logToWriter (_dddf .Output ,_ce ,format ,args ...);};};
// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _cb .Writer ;};var ReleasedAt =_e .Date (_ee ,_ce ,_bge ,_gb ,_bd ,0,0,_e .UTC );

// Warning logs warning message.
func (_dae WriterLogger )Warning (format string ,args ...interface{}){if _dae .LogLevel >=LogLevelWarning {_agd :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_dae .logToWriter (_dae .Output ,_agd ,format ,args ...);};};
// Error does nothing for dummy logger.
func (DummyLogger )Error (format string ,args ...interface{}){};

// Debug does nothing for dummy logger.
func (DummyLogger )Debug (format string ,args ...interface{}){};const _feb =15;
// Notice logs notice message.
func (_caf WriterLogger )Notice (format string ,args ...interface{}){if _caf .LogLevel >=LogLevelNotice {_bf :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_caf .logToWriter (_caf .Output ,_bf ,format ,args ...);};};

// Info does nothing for dummy logger.
func (DummyLogger )Info (format string ,args ...interface{}){};
// Debug logs debug message.
func (_abd ConsoleLogger )Debug (format string ,args ...interface{}){if _abd .LogLevel >=LogLevelDebug {_gd :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_abd .output (_eg .Stdout ,_gd ,format ,args ...);};};

// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_be string ,_ad ...interface{});Warning (_ca string ,_dd ...interface{});Notice (_ag string ,_ge ...interface{});Info (_cc string ,_bb ...interface{});Debug (_ab string ,_db ...interface{});Trace (_ec string ,_dde ...interface{});
IsLogLevel (_abf LogLevel )bool ;};
// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_gc WriterLogger )IsLogLevel (level LogLevel )bool {return _gc .LogLevel >=level };

// Error logs error message.
func (_cg ConsoleLogger )Error (format string ,args ...interface{}){if _cg .LogLevel >=LogLevelError {_aa :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_cg .output (_ee .Stdout ,_aa ,format ,args ...);};};
// DummyLogger does nothing.
type DummyLogger struct{};

// Warning does nothing for dummy logger.
func (DummyLogger )Warning (format string ,args ...interface{}){};
// LogLevel is the verbosity level for logging.
type LogLevel int ;const _ee =2024;

// Notice logs notice message.
func (_bgc ConsoleLogger )Notice (format string ,args ...interface{}){if _bgc .LogLevel >=LogLevelNotice {_eg :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_bgc .output (_ee .Stdout ,_eg ,format ,args ...);};};
// Debug does nothing for dummy logger.
func (DummyLogger )Debug (format string ,args ...interface{}){};

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

// Info logs info message.
func (_geb ConsoleLogger )Info (format string ,args ...interface{}){if _geb .LogLevel >=LogLevelInfo {_bed :="\u005bI\u004e\u0046\u004f\u005d\u0020";_geb .output (_ee .Stdout ,_bed ,format ,args ...);};};
func (_ffa WriterLogger )Info (format string ,args ...interface{}){if _ffa .LogLevel >=LogLevelInfo {_fc :="\u005bI\u004e\u0046\u004f\u005d\u0020";_ffa .logToWriter (_ffa .Output ,_fc ,format ,args ...);};};

// Debug logs debug message.
func (_gd ConsoleLogger )Debug (format string ,args ...interface{}){if _gd .LogLevel >=LogLevelDebug {_de :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_gd .output (_ee .Stdout ,_de ,format ,args ...);};};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;
LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);
// NewConsoleLogger creates new console logger.
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};

// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};func (_bf WriterLogger )logToWriter (_af _b .Writer ,_fd string ,_afc string ,_eb ...interface{}){_adf (_af ,_fd ,_afc ,_eb );};
// Trace logs trace message.
func (_ebf ConsoleLogger )Trace (format string ,args ...interface{}){if _ebf .LogLevel >=LogLevelTrace {_bc :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_ebf .output (_eg .Stdout ,_bc ,format ,args ...);};};

// Debug logs debug message.
func (_edc WriterLogger )Debug (format string ,args ...interface{}){if _edc .LogLevel >=LogLevelDebug {_efb :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_edc .logToWriter (_edc .Output ,_efb ,format ,args ...);};};
// Trace does nothing for dummy logger.
func (DummyLogger )Trace (format string ,args ...interface{}){};func (_afc WriterLogger )logToWriter (_faa _cb .Writer ,_afbb string ,_fae string ,_aeb ...interface{}){_de (_faa ,_afbb ,_fae ,_aeb );};

// Error logs error message.
func (_dda WriterLogger )Error (format string ,args ...interface{}){if _dda .LogLevel >=LogLevelError {_ef :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_dda .logToWriter (_dda .Output ,_ef ,format ,args ...);};};const _ccgg =12;
// Warning logs warning message.
func (_baeb WriterLogger )Warning (format string ,args ...interface{}){if _baeb .LogLevel >=LogLevelWarning {_afb :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_baeb .logToWriter (_baeb .Output ,_afb ,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 (_agf WriterLogger )IsLogLevel (level LogLevel )bool {return _agf .LogLevel >=level };
// Trace logs trace message.
func (_fed WriterLogger )Trace (format string ,args ...interface{}){if _fed .LogLevel >=LogLevelTrace {_egdc :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_fed .logToWriter (_fed .Output ,_egdc ,format ,args ...);};};const _bge =22;

// UtcTimeFormat returns a formatted string describing a UTC timestamp.
func UtcTimeFormat (t _e .Time )string {return t .Format (_bab )+"\u0020\u0055\u0054\u0043"};

// Notice logs notice message.
func (_ddd WriterLogger )Notice (format string ,args ...interface{}){if _ddd .LogLevel >=LogLevelNotice {_ed :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_ddd .logToWriter (_ddd .Output ,_ed ,format ,args ...);};};
func (_be ConsoleLogger )Notice (format string ,args ...interface{}){if _be .LogLevel >=LogLevelNotice {_ac :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_be .output (_eg .Stdout ,_ac ,format ,args ...);};};

// Trace does nothing for dummy logger.
func (DummyLogger )Trace (format string ,args ...interface{}){};
// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_f string ,_cc ...interface{});Warning (_g string ,_fd ...interface{});Notice (_b string ,_eb ...interface{});Info (_a string ,_ba ...interface{});Debug (_ff string ,_ad ...interface{});Trace (_da string ,_ga ...interface{});
IsLogLevel (_bg LogLevel )bool ;};

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

// Warning logs warning message.
func (_cd ConsoleLogger )Warning (format string ,args ...interface{}){if _cd .LogLevel >=LogLevelWarning {_ab :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_cd .output (_eg .Stdout ,_ab ,format ,args ...);};};const _gb =15;

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

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

// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _b .Writer ;};
// Error logs error message.
func (_fe ConsoleLogger )Error (format string ,args ...interface{}){if _fe .LogLevel >=LogLevelError {_dd :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_fe .output (_eg .Stdout ,_dd ,format ,args ...);};};

// Warning logs warning message.
func (_bg ConsoleLogger )Warning (format string ,args ...interface{}){if _bg .LogLevel >=LogLevelWarning {_f :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_bg .output (_ee .Stdout ,_f ,format ,args ...);};};func (_da ConsoleLogger )output (_ac _b .Writer ,_bd string ,_ccg string ,_bba ...interface{}){_adf (_ac ,_bd ,_ccg ,_bba ...);
};
// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };func (_ag ConsoleLogger )output (_af _cb .Writer ,_ea string ,_bae string ,_ddb ...interface{}){_de (_af ,_ea ,_bae ,_ddb ...);};const Version ="\u0033\u002e\u0035\u0034\u002e\u0030";

// Trace logs trace message.
func (_gg ConsoleLogger )Trace (format string ,args ...interface{}){if _gg .LogLevel >=LogLevelTrace {_ga :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_gg .output (_ee .Stdout ,_ga ,format ,args ...);};};
// Info logs info message.
func (_cg ConsoleLogger )Info (format string ,args ...interface{}){if _cg .LogLevel >=LogLevelInfo {_dg :="\u005bI\u004e\u0046\u004f\u005d\u0020";_cg .output (_eg .Stdout ,_dg ,format ,args ...);};};

// DummyLogger does nothing.
type DummyLogger struct{};var ReleasedAt =_d .Date (_fcf ,_ccgg ,_ecb ,_feb ,_gc ,0,0,_d .UTC );func _adf (_ae _b .Writer ,_bgb string ,_cgc string ,_fe ...interface{}){_ ,_gf ,_aef ,_gac :=_c .Caller (3);if !_gac {_gf ="\u003f\u003f\u003f";_aef =0;}else {_gf =_g .Base (_gf );
};_def :=_e .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_bgb ,_gf ,_aef )+_cgc +"\u000a";_e .Fprintf (_ae ,_def ,_fe ...);};const _gc =30;
// Error logs error message.
func (_fa WriterLogger )Error (format string ,args ...interface{}){if _fa .LogLevel >=LogLevelError {_ae :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_fa .logToWriter (_fa .Output ,_ae ,format ,args ...);};};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;
LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;);const _bd =30;

// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};var Log Logger =DummyLogger {};

// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_ba ConsoleLogger )IsLogLevel (level LogLevel )bool {return _ba .LogLevel >=level };

// UtcTimeFormat returns a formatted string describing a UTC timestamp.
func UtcTimeFormat (t _d .Time )string {return t .Format (_cd )+"\u0020\u0055\u0054\u0043"};const _fcf =2023;
func (_egd ConsoleLogger )IsLogLevel (level LogLevel )bool {return _egd .LogLevel >=level };

// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _b .Writer )*WriterLogger {_df :=WriterLogger {Output :writer ,LogLevel :logLevel };return &_df ;};const _cd ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";
func NewWriterLogger (logLevel LogLevel ,writer _cb .Writer )*WriterLogger {_cab :=WriterLogger {Output :writer ,LogLevel :logLevel };return &_cab ;};const _ce =1;func _de (_abg _cb .Writer ,_ebfa string ,_gfe string ,_abc ...interface{}){_ ,_ege ,_bb ,_egb :=_ec .Caller (3);
if !_egb {_ege ="\u003f\u003f\u003f";_bb =0;}else {_ege =_ca .Base (_ege );};_bea :=_c .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_ebfa ,_ege ,_bb )+_gfe +"\u000a";_c .Fprintf (_abg ,_bea ,_abc ...);};


// NewConsoleLogger creates new console logger.
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};const _ecb =17;

// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };

// LogLevel is the verbosity level for logging.
type LogLevel int ;

// Info logs info message.
func (_fc WriterLogger )Info (format string ,args ...interface{}){if _fc .LogLevel >=LogLevelInfo {_cb :="\u005bI\u004e\u0046\u004f\u005d\u0020";_fc .logToWriter (_fc .Output ,_cb ,format ,args ...);};};
// Info does nothing for dummy logger.
func (DummyLogger )Info (format string ,args ...interface{}){};const _bab ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";
36 changes: 18 additions & 18 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 _b "github.com/unidoc/unipdf/v3/internal/license";

// 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 ){_b .SetMeteredKeyPersistentCache (val )};const (LicenseTierUnlicensed =_b .LicenseTierUnlicensed ;LicenseTierCommunity =_b .LicenseTierCommunity ;LicenseTierIndividual =_b .LicenseTierIndividual ;LicenseTierBusiness =_b .LicenseTierBusiness ;
package license ;import _ag "github.com/unidoc/unipdf/v3/internal/license";const (LicenseTierUnlicensed =_ag .LicenseTierUnlicensed ;LicenseTierCommunity =_ag .LicenseTierCommunity ;LicenseTierIndividual =_ag .LicenseTierIndividual ;LicenseTierBusiness =_ag .LicenseTierBusiness ;
);

// 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 _b .SetMeteredKey (apiKey )};

// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _b .MakeUnlicensedKey ()};
// LicenseKey represents a loaded license key.
type LicenseKey =_ag .LicenseKey ;

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

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

// 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 _ag .SetMeteredKey (apiKey )};

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

// LicenseKey represents a loaded license key.
type LicenseKey =_b .LicenseKey ;
// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _ag .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 ){_ag .SetMeteredKeyPersistentCache (val )};
Loading

0 comments on commit 713619f

Please sign in to comment.