NLS_DIV // has to open a new
} new_line_state;
// track the original (unscaled) values to determine scaling and merge lines
// current position
double cur_tx, cur_ty; // real text position, in text coords
double cur_font_size;
// this is CTM * TextMAT in PDF
// as we'll calculate the position of the origin separately
double cur_text_tm[6]; // unscaled
bool all_changed;
bool ctm_changed;
bool rise_changed;
bool font_changed;
bool text_pos_changed;
bool text_mat_changed;
bool fill_color_changed;
bool hori_scale_changed;
bool word_space_changed;
bool letter_space_changed;
bool stroke_color_changed;
// font & size
const FontInfo * cur_font_info;
// managers store values actually used in HTML (i.e. scaled)
////////////////////////////////////////////////
TransformMatrixManager transform_matrix_manager;
StrokeColorManager stroke_color_manager;
LetterSpaceManager letter_space_manager;
WhitespaceManager whitespace_manager;
WordSpaceManager word_space_manager;
FillColorManager fill_color_manager;
FontSizeManager font_size_manager;
BottomManager bottom_manager;
HeightManager height_manager;
WidthManager width_manager;
RiseManager rise_manager;
LeftManager left_manager;
////////////////////////////////////////////////
BGImageSizeManager bgimage_size_manager;
// optimize for web
// we try to render the final font size directly
// to reduce the effect of ctm as much as possible
// the actual tm used is `real tm in PDF` scaled by 1/draw_text_scale,
// so everything rendered should be multiplied by draw_text_scale
double draw_text_scale;
// the position of next char, in text coords
// this is actual position (in HTML), which might be different from cur_tx/ty (in PDF)
// also keep in mind that they are not the final position, as they will be transform by CTM (also true for cur_tx/ty)
double draw_tx, draw_ty;
// some metrics have to be determined after all elements in the lines have been seen
// see TextLineBuffer.h
class TextLineBuffer;
friend class TextLineBuffer;
TextLineBuffer * text_line_buf;
// for font reencoding
int32_t * cur_mapping;
char ** cur_mapping2;
int * width_list;
Preprocessor preprocessor;
TmpFiles tmp_files;
// for string formatting
StringFormatter str_fmt;
////////////////////////////////////////////////////
// styles & resources
////////////////////////////////////////////////////
std::unordered_map font_name_map;
const Param * param;
struct {
std::ofstream fs;
std::string path;
} f_outline, f_pages, f_css;
static const std::string MANIFEST_FILENAME;
};
} //namespace pdf2htmlEX
#endif /* HTMLRENDERER_H_ */