20#include "RConfigure.h"
23# define X_DISPLAY_MISSING 1
24# define popen_flags "r"
26# include "Windows4root.h"
27# define popen_flags "rb"
30# define popen_flags "r"
34# include <afterbase.h>
36# include <win32/config.h>
37# include <win32/afterbase.h>
38# define X_DISPLAY_MISSING 1
77 Warning(
"File2ASImage",
"GhostScript is not available");
82 Warning(
"File2ASImage",
"input file %s is not accessible", filename);
86 TString ext = (strrchr(filename,
'.') + 1);
96 FILE *fd = fopen(filename,
"r");
98 Warning(
"File2ASImage",
"input file %s is not readable", filename);
105 if (
line.IsNull() || !
line.BeginsWith(
"%"))
break;
107 if (
line.BeginsWith(
"%%BoundingBox:")) {
110 sscanf(
line.Data(),
"%d %d %d %d", &lx, &ly, &ux, &uy);
125 cmd +=
" -dSAFER -dBATCH -dNOPAUSE -dQUIET -sDEVICE=png16m -dGraphicsAlphaBits=4 -sOutputFile=- ";
133 const UInt_t kBuffLength = 32768;
134 static char buf[kBuffLength];
138 Long_t r = fread(&buf, 1, kBuffLength, in);
139 raw.
Append((
const char*)&buf,
r);
144 ASImageImportParams params;
146 params.width =
width;
147 params.height = height;
148 params.filter = SCL_DO_ALL;
150 params.gamma_table = 0;
151 params.compression = 0;
152 params.format = ASA_ASImage;
153 params.search_path = 0;
156 ASImage *ret = PNGBuff2ASimage((CARD8 *)raw.
Data(), ¶ms);
include TDocParser_001 C image html pict1_TDocParser_001 png width
char * Form(const char *fmt,...)
char * StrDup(const char *str)
Duplicate the string str.
R__EXTERN TSystem * gSystem
Allows to read PS/EPS/PDF files via GhostScript.
char * fInterpreter
path to GhostScript interpreter
TASPluginGS(const char *ext)
ctor
ASImage * File2ASImage(const char *filename)
read PS/EPS/PDF file and convert it to ASImage
virtual ~TASPluginGS()
dtor
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void ToLower()
Change string to lower-case.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
const char * Data() const
TString & Append(const char *cs)
virtual const char * Getenv(const char *env)
Get environment variable.
virtual FILE * OpenPipe(const char *command, const char *mode)
Open a pipe.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual int ClosePipe(FILE *pipe)
Close the pipe.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.