Example #1
0
void AnnotWriter::DoFreeText(FreeTextAnnot* a){
	GString appearance;
	char buf[250];
	PDFFont* font;
	GfxRGB* color;
	// build appearance string
	font = a->GetFont();
	color = a->GetFontColor();
	appearance.clear();
	// color
	sprintf(buf, "[%g %g %g] rg ", colToDbl(color->r), colToDbl(color->g), colToDbl(color->b));
	appearance.append(buf);

	// font and size
	sprintf(buf, "/%s %g Tf", font->GetShortName(), a->GetFontSize());
	appearance.append(buf);
	a->SetAppearance(&appearance);

	DoStyledAnnot(a);
	AddAnnotSubtype("FreeText");
	AddAnnotContents(a);
	AddString(&mAnnot, "DA", a->GetAppearance());
	if (a->GetJustification() != left_justify) {
		AddInteger(&mAnnot, "Q", a->GetJustification());
	}

	WriteFont(a->GetFont());
}
Example #2
0
static void setGlobalParameter(const char* type, const char* arg1, const char* arg2 = NULL) {
	GString line;
	line.append(type);
	line.append(" ");
	line.append(arg1);
	if (arg2 != NULL) {
		line.append(" ");
		line.append(arg2);
	}
	GString name("BepdfApplication");
	globalParams->parseLine(line.getCString(), &name, 0);
}