/*
 * Class:     org_libharu_PdfPage
 * Method:    fillStroke
 * Signature: ()V
 */
JNIEXPORT void JNICALL
Java_org_libharu_PdfPage_fillStroke(JNIEnv *env, jobject obj) {
    jint page;
    /* Get mHPDFPagePointer */
    page = (*env)->GetIntField(env, obj, mHPDFPagePointer);
    HPDF_Page_FillStroke((HPDF_Page) page);
}
예제 #2
0
JNIEXPORT void JNICALL Java_org_libharu_Page_fillStroke
  (JNIEnv *env, jobject obj)
{
  haru_setup_error_handler(env, __func__);
  HPDF_Page page = get_HPDF_Page(env, obj); 
  HPDF_Page_FillStroke(page);
  haru_clear_error_handler();
}
예제 #3
0
void WPdfImage::paintPath()
{
  if (painter()->pen().style() != PenStyle::None)
    if (painter()->brush().style() != BrushStyle::None)
      HPDF_Page_FillStroke(page_);
    else
      HPDF_Page_Stroke(page_);
  else
    if (painter()->brush().style() != BrushStyle::None)
      HPDF_Page_Fill(page_);
    else
      HPDF_Page_EndPath(page_);
}
예제 #4
0
파일: WPdfImage.C 프로젝트: ReWeb3D/wt
void WPdfImage::paintPath()
{
  if (painter()->pen().style() != NoPen)
    if (painter()->brush().style() != NoBrush)
      HPDF_Page_FillStroke(page_);
    else
      HPDF_Page_Stroke(page_);
  else
    if (painter()->brush().style() != NoBrush)
      HPDF_Page_Fill(page_);
    else
      HPDF_Page_EndPath(page_);
}
예제 #5
0
파일: save_pdf.c 프로젝트: kyllikki/netsurf
bool pdf_plot_path(const float *p, unsigned int n, colour fill, float width,
		colour c, const float transform[6])
{
	unsigned int i;
	bool empty_path;

#ifdef PDF_DEBUG
	NSLOG(netsurf, INFO, ".");
#endif

	if (n == 0)
		return true;

	if (c == NS_TRANSPARENT && fill == NS_TRANSPARENT)
		return true;

	if (p[0] != PLOTTER_PATH_MOVE)
		return false;

	apply_clip_and_mode(false, fill, c, width, DashPattern_eNone);

	empty_path = true;
	for (i = 0 ; i < n ; ) {
		if (p[i] == PLOTTER_PATH_MOVE) {
			HPDF_Page_MoveTo(pdf_page,
					transform_x(transform, p[i+1], p[i+2]),
					transform_y(transform, p[i+1], p[i+2]));
			i+= 3;
		} else if (p[i] == PLOTTER_PATH_CLOSE) {
			if (!empty_path)
				HPDF_Page_ClosePath(pdf_page);
			i++;
		} else if (p[i] == PLOTTER_PATH_LINE) {
			HPDF_Page_LineTo(pdf_page,
					transform_x(transform, p[i+1], p[i+2]),
					transform_y(transform, p[i+1], p[i+2]));
			i+=3;
			empty_path = false;
		} else if (p[i] == PLOTTER_PATH_BEZIER) {
			HPDF_Page_CurveTo(pdf_page,
					transform_x(transform, p[i+1], p[i+2]),
					transform_y(transform, p[i+1], p[i+2]),
					transform_x(transform, p[i+3], p[i+4]),
					transform_y(transform, p[i+3], p[i+4]),
					transform_x(transform, p[i+5], p[i+6]),
					transform_y(transform, p[i+5], p[i+6]));
			i += 7;
			empty_path = false;
		} else {
			NSLOG(netsurf, INFO, "bad path command %f", p[i]);
			return false;
		}
	}

	if (empty_path) {
		HPDF_Page_EndPath(pdf_page);
		return true;
	}

	if (fill != NS_TRANSPARENT) {
		if (c != NS_TRANSPARENT)
			HPDF_Page_FillStroke(pdf_page);
		else
			HPDF_Page_Fill(pdf_page);
	}
	else
		HPDF_Page_Stroke(pdf_page);

	return true;
}