: m_ObjWriter(&obj_writer),
55m_ObjIdGenerator(objid_gen),
56m_FontHandler(font_handler),
57m_PageTreeRootObj(new
CPdfObject(m_ObjIdGenerator->NextId())),
58m_PageBuffers(&buffers),
59m_PanelLinkTriHeight(6),
61m_PanelLinkTextHeight(8)
97root[
"Type"] =
new CPdfName(
"Pages");
105root[
"Kids"] = kids;
113root[
"MediaBox"] = mediabox;
128dict.
Add(pagedict);
132(*resources)[
"ProcSet"] = procset;
136(*_res)[
"ProcSet"] = procset;
162 const boolhas_header = header.
text.length() > 0;
163 const boolhas_footer = footer.
text.length() > 0;
165 if(has_header || has_footer) {
168obj <<
"0 0 m n"<<
pdfbrk;
169obj <<
"0 0 0 rg"<<
pdfbrk;
190pmarks <<
"0 0 m n"<<
pdfbrk;
191pmarks <<
"0 0 0 rg"<<
pdfbrk;
192pmarks <<
"BT"<<
pdfbrk;
202 conststring::size_type pstr_len(pstr.length() * 8);
206pmarks <<
"ET"<<
pdfbrk;
223 const TPdfUnitlink_margin = link_height + 2;
235 const TPdfUnity = link_margin - 10;
253 if(annots->GetArray().size() > 0) {
254panelobj[
"Annots"] = annots;
265 const TPdfUnitcm_lm = cm_l - margin;
267 const TPdfUnitcm_tm = cm_t + margin;
269 const TPdfUnitcm_rm = cm_r + margin;
271 const TPdfUnitcm_bm = cm_b - margin;
274obj << cm_lm - cmark_len <<
' '<< cm_t <<
" m " 275<< cm_lm <<
' '<< cm_t <<
" l s"<<
pdfbrk;
277obj << cm_l <<
' '<< cm_tm + cmark_len <<
" m " 278<< cm_l <<
' '<< cm_tm <<
" l s"<<
pdfbrk;
281obj << cm_rm + cmark_len <<
' '<< cm_t <<
" m " 282<< cm_rm <<
' '<< cm_t <<
" l s"<<
pdfbrk;
284obj << cm_r <<
' '<< cm_tm + cmark_len <<
" m " 285<< cm_r <<
' '<< cm_tm <<
" l s"<<
pdfbrk;
288obj << cm_lm - cmark_len <<
' '<< cm_b <<
" m " 289<< cm_lm <<
' '<< cm_b <<
" l s"<<
pdfbrk;
291obj << cm_l <<
' '<< cm_bm - cmark_len <<
" m " 292<< cm_l <<
' '<< cm_bm <<
" l s"<<
pdfbrk;
295obj << cm_rm + cmark_len <<
' '<< cm_b <<
" m " 296<< cm_rm <<
' '<< cm_b <<
" l s"<<
pdfbrk;
298obj << cm_r <<
' '<< cm_bm - cmark_len <<
" m " 299<< cm_r <<
' '<< cm_bm <<
" l s"<<
pdfbrk;
304 unsigned intpanel_num,
311 const TPdfUnitlink_width2 = link_width / 2;
321rot = (side ==
eTop) ? 0 : 180;
322xlate_x = x - link_width2;
328xlate_y = y - link_width2;
333xlate_y = y + link_width2;
347obj <<
"4 1 Td"<<
pdfbrk;
364 x_DrawTriangle(obj, link_width / 2, fnt_h + _margin, tri_w, tri_h);
369link[
"Type"] =
new CPdfName(
"Annot");
370link[
"Subtype"] =
new CPdfName(
"Link");
372 string_x1, _x2, _y1, _y2;
384 const boolleft = (side ==
eLeft);
392link[
"Rect"] =
new CPdfElement(
"["+ _x1 +
" "+ _y1 +
" "+ _x2 +
" "+ _y2 +
"]");
394link[
"C"] =
new CPdfElement(
"[0.416 0.549 0.792]");
400link[
"Dest"] = dest;
435clip << L <<
' '<<
B<<
" m ";
436clip <<
R<<
' '<<
B<<
" l ";
437clip <<
R<<
' '<<
T<<
" l ";
438clip << L <<
' '<<
T<<
" l W n"<<
pdfbrk;
456xform << scale.first <<
" 0 0 "<< scale.second <<
" 0 0 cm"<<
pdfbrk;
461xform <<
"1 0 0 1 "<< -x_off <<
' '<< -y_off <<
" cm"<<
pdfbrk;
474xform <<
"1 0 0 1 "<< -
offset.first <<
' '<< -
offset.second <<
" cm"<<
pdfbrk;
501 returnmake_pair(h_offset, v_offset);
584 const floatscale_w = float(total_w) / w;
585 const floatscale_h = float(total_h) / h;
588 const floatscale = scale_w < scale_h ? scale_w : scale_h;
589 returnmake_pair(scale, scale);
592 returnmake_pair(scale_w, scale_h);
624 return TSize(scale.first * sz.first,
625scale.second * sz.second
668 unsigned intpanel_num = 1;
672 for(
unsigned int row= 0;
row< pg_tall; ++
row) {
675 for(
unsigned intcol = 0; col < pg_wide; ++col, ++panel_num) {
732pageobj[
"Type"] =
new CPdfName(
"Page");
734pageobj[
"Contents"] = contents;
736 if(annots->GetArray().size() > 0)
737pageobj[
"Annots"] = annots;
CIdGenerator - generates consecutive integer identifiers.
CBBox< 3 > GetBoundingBox() const
TOffset GetPageSize(void) const
pair< unsigned int, unsigned int > TOffset
TPdfObjectRef x_CreateHeaderFooter(void)
void x_PrintText(CPdfObject &obj, const CPrintOptions::SText &txt, TPdfUnit yoffset)
CRef< CPdfArray > x_DrawPanelLink(CPdfObject &obj, unsigned int panel_num, TPdfUnit x, TPdfUnit y, enum Side side=eTop) const
CPageHandler(const CPageBuffers &buffers, CPdfObjectWriter &obj_writer, CIdGenerator *objid_gen, CPdfFontHandler *font_handler)
TPdfUnit m_PanelLinkTriHeight
pair< float, float > x_GetPageScaling(TPdfUnit w, TPdfUnit h, bool keepAspect=true) const
vector< TPdfObjectRef > m_ContentVec
TPdfObjectRef x_CreateContentXForm(void)
TPdfObjectRef m_PageTreeRootObj
void SetOptions(const CPrintOptions &options)
void x_UpdatePageTreeRoot(const CRef< CPdfDictionary > &pagedict)
CRef< CPdfFontHandler > m_FontHandler
void x_CreatePage(TPdfObjectRef page, CRef< CPdfArray > &contents, CRef< CPdfArray > &annots)
void x_DrawTriangle(CPdfObject &obj, TPdfUnit x, TPdfUnit y, TPdfUnit width, TPdfUnit height) const
unsigned int WritePages(void)
pair< TPdfUnit, TPdfUnit > TSize
TOffset x_GetPanelOffset(const CRef< CPanel > &panel) const
void AddContent(const TPdfObjectRef &content)
pair< TPdfUnit, TPdfUnit > TOffset
void x_DrawCornerCropMarks(CPdfObject &obj, TPdfUnit margin) const
TPdfObjectRef x_CreatePrintersMarks(const CRef< CPanel > &panel)
void WritePageTree(const CRef< CPdfDictionary > &pagedict)
const CPageBuffers * m_PageBuffers
TPdfObjectRef GetObject(void) const
CRef< CPanelGrid > m_PanelGrid
vector< TPdfObjectRef > m_Pages
const TSize x_GetScaledPageSize(void) const
vector< TPdfObjectRef > m_AnnotVec
TPdfObjectRef x_CreatePageXForm(const CRef< CPanel > &panel)
const CPrintOptions * m_Options
TPdfUnit m_PanelLinkMargin
TPdfObjectRef x_CreatePageClipObject(void)
void x_Update(const CRef< CPdfDictionary > &pagedict)
TPdfUnit m_PanelLinkTextHeight
void AddAnnot(const TPdfObjectRef &content)
CPdfObjectWriter * m_ObjWriter
vector< TPdfObjectRef > m_StdContents
CRef< CIdGenerator > m_ObjIdGenerator
TPanelRef GetPanel(unsigned int panel) const
unsigned int GetNumPanels(void) const
SNeighbors GetNeighbours(unsigned int row, unsigned int col) const
unsigned int m_VPageOffset
CRef< CPdfObject > m_Panel
unsigned int m_HPageOffset
vector< TPdfEltRef > TArray
void Add(const CRef< CPdfDictionary > &dict)
string GetFontName(EFontFace fontface) const
void WriteObject(const CRef< CPdfObject > &obj)
CPdfDictionary & GetDictionary(void)
const SText & GetHeaderDetails(void) const
TPdfUnit GetMarginTop(void) const
TPdfUnit GetPageTrimWidth(void) const
const SText & GetFooterDetails(void) const
unsigned int GetNumPages(void) const
TPdfUnit GetMediaHeight(void) const
unsigned int GetPagesTall(void) const
unsigned int GetPagesWide(void) const
TPdfUnit GetUserUnit() const
TPageOrientation GetPageOrientation(void) const
TPdfUnit GetMarginLeft(void) const
TPdfUnit GetMediaWidth(void) const
TPdfUnit GetMarginBottom(void) const
TPdfUnit GetMarginRight(void) const
TPdfUnit GetPageTrimHeight(void) const
TPdfUnit GetFooterOffset(void) const
TPdfUnit GetHeaderOffset(void) const
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
unsigned int NextId(void)
pair< float, float > GetNthRange(unsigned int n) const
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
CPdfObject & pdfbrk(CPdfObject &pdfstrm)
#define row(bind, expected)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4