Skip to content

Commit

Permalink
Merge pull request #546 from unidoc-build/prep-rc-v3.55.0
Browse files Browse the repository at this point in the history
Release v3.55.0
  • Loading branch information
gunnsth authored Feb 12, 2024
2 parents 713619f + 4cb53db commit 9501e13
Show file tree
Hide file tree
Showing 65 changed files with 15,755 additions and 15,793 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ The profits are invested back into making unipdf better. We want to make the bes

If you are interested in contributing, please contact us.

## Go Version Compatibility

Officially we support three latest Go versions, but internally we would test the build with up to five latest Go versions in our CI runner.

## Support and consulting

Please email us at [email protected] for any queries.
Expand Down
825 changes: 411 additions & 414 deletions annotator/annotator.go

Large diffs are not rendered by default.

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

// Package common contains common properties used by the subpackages.
package common ;import (_c "fmt";_cb "io";_eg "os";_ca "path/filepath";_ec "runtime";_e "time";);

// 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 );

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

// 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 ...);};};

// 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 ...);};};
package common ;import (_e "fmt";_fe "io";_fc "os";_g "path/filepath";_f "runtime";_c "time";);

// 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 };
func (_eb ConsoleLogger )IsLogLevel (level LogLevel )bool {return _eb .LogLevel >=level };

// DummyLogger does nothing.
type DummyLogger struct{};
// NewWriterLogger creates new 'writer' logger.
func NewWriterLogger (logLevel LogLevel ,writer _fe .Writer )*WriterLogger {_cg :=WriterLogger {Output :writer ,LogLevel :logLevel };return &_cg ;};const Version ="\u0033\u002e\u0035\u0035\u002e\u0030";var Log Logger =DummyLogger {};

// LogLevel is the verbosity level for logging.
type LogLevel int ;const _ee =2024;
// Error logs error message.
func (_fg ConsoleLogger )Error (format string ,args ...interface{}){if _fg .LogLevel >=LogLevelError {_ba :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_fg .output (_fc .Stdout ,_ba ,format ,args ...);};};

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

// IsLogLevel returns true from dummy logger.
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };
// NewConsoleLogger creates new console logger.
func NewConsoleLogger (logLevel LogLevel )*ConsoleLogger {return &ConsoleLogger {LogLevel :logLevel }};const (LogLevelTrace LogLevel =5;LogLevelDebug LogLevel =4;LogLevelInfo LogLevel =3;LogLevelNotice LogLevel =2;LogLevelWarning LogLevel =1;LogLevelError LogLevel =0;
);

// Info logs info message.
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 ...);};};
// Notice logs notice message.
func (_ed WriterLogger )Notice (format string ,args ...interface{}){if _ed .LogLevel >=LogLevelNotice {_aed :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_ed .logToWriter (_ed .Output ,_aed ,format ,args ...);};};

// 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 ;};

// 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 ...);};};
func (_fca ConsoleLogger )Trace (format string ,args ...interface{}){if _fca .LogLevel >=LogLevelTrace {_age :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_fca .output (_fc .Stdout ,_age ,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 );};
// Notice logs notice message.
func (_ga ConsoleLogger )Notice (format string ,args ...interface{}){if _ga .LogLevel >=LogLevelNotice {_ae :="\u005bN\u004f\u0054\u0049\u0043\u0045\u005d ";_ga .output (_fc .Stdout ,_ae ,format ,args ...);};};

// Error logs error message.
func (_df WriterLogger )Error (format string ,args ...interface{}){if _df .LogLevel >=LogLevelError {_cf :="\u005b\u0045\u0052\u0052\u004f\u0052\u005d\u0020";_df .logToWriter (_df .Output ,_cf ,format ,args ...);};};

// 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 ...);};};
func (_fea ConsoleLogger )Warning (format string ,args ...interface{}){if _fea .LogLevel >=LogLevelWarning {_dc :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_fea .output (_fc .Stdout ,_dc ,format ,args ...);};};

// 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;
func (_da WriterLogger )Trace (format string ,args ...interface{}){if _da .LogLevel >=LogLevelTrace {_efb :="\u005b\u0054\u0052\u0041\u0043\u0045\u005d\u0020";_da .logToWriter (_da .Output ,_efb ,format ,args ...);};};func _fd (_dgc _fe .Writer ,_gca string ,_de string ,_ca ...interface{}){_ ,_gabb ,_ebe ,_bg :=_f .Caller (3);
if !_bg {_gabb ="\u003f\u003f\u003f";_ebe =0;}else {_gabb =_g .Base (_gabb );};_bd :=_e .Sprintf ("\u0025s\u0020\u0025\u0073\u003a\u0025\u0064 ",_gca ,_gabb ,_ebe )+_de +"\u000a";_e .Fprintf (_dgc ,_bd ,_ca ...);};

// Info logs info message.
func (_bab WriterLogger )Info (format string ,args ...interface{}){if _bab .LogLevel >=LogLevelInfo {_ged :="\u005bI\u004e\u0046\u004f\u005d\u0020";_bab .logToWriter (_bab .Output ,_ged ,format ,args ...);};};var ReleasedAt =_c .Date (_bda ,_fa ,_dd ,_gcd ,_eba ,0,0,_c .UTC );


// UtcTimeFormat returns a formatted string describing a UTC timestamp.
func UtcTimeFormat (t _e .Time )string {return t .Format (_bab )+"\u0020\u0055\u0054\u0043"};
func UtcTimeFormat (t _c .Time )string {return t .Format (_ad )+"\u0020\u0055\u0054\u0043"};func (_ccc ConsoleLogger )output (_gb _fe .Writer ,_aga string ,_eg string ,_ff ...interface{}){_fd (_gb ,_aga ,_eg ,_ff ...);};const _fa =2;

// Notice logs notice message.
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 ...);};};
// Debug does nothing for dummy logger.
func (DummyLogger )Debug (format string ,args ...interface{}){};const _gcd =15;const _dd =12;

// 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 ;};
// Debug logs debug message.
func (_ccf WriterLogger )Debug (format string ,args ...interface{}){if _ccf .LogLevel >=LogLevelDebug {_efe :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_ccf .logToWriter (_ccf .Output ,_efe ,format ,args ...);};};const _eba =30;

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

// 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;
// Info does nothing for dummy logger.
func (DummyLogger )Info (format string ,args ...interface{}){};

// 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 ...);};};
// WriterLogger is the logger that writes data to the Output writer
type WriterLogger struct{LogLevel LogLevel ;Output _fe .Writer ;};

// Logger is the interface used for logging in the unipdf package.
type Logger interface{Error (_ec string ,_ea ...interface{});Warning (_ef string ,_ac ...interface{});Notice (_cc string ,_d ...interface{});Info (_b string ,_bf ...interface{});Debug (_aa string ,_gg ...interface{});Trace (_cb string ,_ag ...interface{});
IsLogLevel (_cd 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 (_ace WriterLogger )IsLogLevel (level LogLevel )bool {return _ace .LogLevel >=level };

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

// 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 ...);};};

// 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";
// LogLevel is the verbosity level for logging.
type LogLevel int ;

// 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 ...);};};
func (_feb ConsoleLogger )Info (format string ,args ...interface{}){if _feb .LogLevel >=LogLevelInfo {_gc :="\u005bI\u004e\u0046\u004f\u005d\u0020";_feb .output (_fc .Stdout ,_gc ,format ,args ...);};};

// 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;
// IsLogLevel returns true from dummy logger.
func (DummyLogger )IsLogLevel (level LogLevel )bool {return true };

// ConsoleLogger is a logger that writes logs to the 'os.Stdout'
type ConsoleLogger struct{LogLevel LogLevel ;};var Log Logger =DummyLogger {};
// Error does nothing for dummy logger.
func (DummyLogger )Error (format string ,args ...interface{}){};const _ad ="\u0032\u0020\u004aan\u0075\u0061\u0072\u0079\u0020\u0032\u0030\u0030\u0036\u0020\u0061\u0074\u0020\u0031\u0035\u003a\u0030\u0034";

// IsLogLevel returns true if log level is greater or equal than `level`.
// Can be used to avoid resource intensive calls to loggers.
func (_egd ConsoleLogger )IsLogLevel (level LogLevel )bool {return _egd .LogLevel >=level };
// SetLogger sets 'logger' to be used by the unidoc unipdf library.
func SetLogger (logger Logger ){Log =logger };func (_fga WriterLogger )logToWriter (_af _fe .Writer ,_cgd string ,_cfg string ,_gaa ...interface{}){_fd (_af ,_cgd ,_cfg ,_gaa );};

// NewWriterLogger creates new 'writer' logger.
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 ...);};
// Warning logs warning message.
func (_dg WriterLogger )Warning (format string ,args ...interface{}){if _dg .LogLevel >=LogLevelWarning {_ge :="\u005b\u0057\u0041\u0052\u004e\u0049\u004e\u0047\u005d\u0020";_dg .logToWriter (_dg .Output ,_ge ,format ,args ...);};};const _bda =2024;

// 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";
// Debug logs debug message.
func (_bc ConsoleLogger )Debug (format string ,args ...interface{}){if _bc .LogLevel >=LogLevelDebug {_dcg :="\u005b\u0044\u0045\u0042\u0055\u0047\u005d\u0020";_bc .output (_fc .Stdout ,_dcg ,format ,args ...);};};

// Trace does nothing for dummy logger.
func (DummyLogger )Trace (format string ,args ...interface{}){};
29 changes: 14 additions & 15 deletions common/license/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,29 @@
// 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 _ag "github.com/unidoc/unipdf/v3/internal/license";const (LicenseTierUnlicensed =_ag .LicenseTierUnlicensed ;LicenseTierCommunity =_ag .LicenseTierCommunity ;LicenseTierIndividual =_ag .LicenseTierIndividual ;LicenseTierBusiness =_ag .LicenseTierBusiness ;
);
package license ;import _fd "github.com/unidoc/unipdf/v3/internal/license";

// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _fd .MakeUnlicensedKey ()};

// LicenseKey represents a loaded license key.
type LicenseKey =_ag .LicenseKey ;
type LicenseKey =_fd .LicenseKey ;const (LicenseTierUnlicensed =_fd .LicenseTierUnlicensed ;LicenseTierCommunity =_fd .LicenseTierCommunity ;LicenseTierIndividual =_fd .LicenseTierIndividual ;LicenseTierBusiness =_fd .LicenseTierBusiness ;);

// 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 ){_fd .SetMeteredKeyPersistentCache (val )};

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

// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _ag .MakeUnlicensedKey ()};
func GetMeteredState ()(_fd .MeteredStatus ,error ){return _fd .GetMeteredState ()};

// 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 )};
func SetMeteredKey (apiKey string )error {return _fd .SetMeteredKey (apiKey )};

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

// 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 )};
func GetLicenseKey ()*LicenseKey {return _fd .GetLicenseKey ()};
Loading

0 comments on commit 9501e13

Please sign in to comment.