<commit_before>package hpdf

/*
#cgo LDFLAGS: -lhpdf -lpng -lz
#include "hpdf.h"
*/
import "C"
import "unsafe"

func (page *Page) BeginText() error {
	C.HPDF_Page_BeginText(page.page)
	return page.pdf.GetLastError()
}

func (page *Page) EndText() error {
	C.HPDF_Page_EndText(page.page)
	return page.pdf.GetLastError()
}

func (page *Page) ShowText(text string) error {
	cText := C.CString(text)

	C.HPDF_Page_ShowText(page.page, cText)

	C.free(unsafe.Pointer(cText))

	return page.pdf.GetLastError()
}

func (page *Page) TextOut(x float32, y float32, text string) error {
	cText := C.CString(text)

	C.HPDF_Page_TextOut(page.page, C.HPDF_REAL(x), C.HPDF_REAL(y), cText)

	C.free(unsafe.Pointer(cText))
	return page.pdf.GetLastError()
}<commit_msg>Wrap HPDF_Page_MoveTextPos.<commit_after>package hpdf

/*
#cgo LDFLAGS: -lhpdf -lpng -lz
#include "hpdf.h"
*/
import "C"
import "unsafe"

func (page *Page) BeginText() error {
	C.HPDF_Page_BeginText(page.page)
	return page.pdf.GetLastError()
}

func (page *Page) EndText() error {
	C.HPDF_Page_EndText(page.page)
	return page.pdf.GetLastError()
}

func (page *Page) ShowText(text string) error {
	cText := C.CString(text)

	C.HPDF_Page_ShowText(page.page, cText)

	C.free(unsafe.Pointer(cText))

	return page.pdf.GetLastError()
}

func (page *Page) TextOut(x float32, y float32, text string) error {
	cText := C.CString(text)

	C.HPDF_Page_TextOut(page.page, C.HPDF_REAL(x), C.HPDF_REAL(y), cText)

	C.free(unsafe.Pointer(cText))
	return page.pdf.GetLastError()
}

func (page *Page) MoveTextPos(x float32, y float32) error {
	C.HPDF_Page_MoveTextPos(page.page, C.HPDF_REAL(x), C.HPDF_REAL(y))
	return page.pdf.GetLastError()
}
{'fraction_non_alphanumeric': 0.15104477611940298, 'fraction_numerical': 0.007164179104477612, 'mean_word_length': 5.094545454545455, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3236392', 'n_tokens_mistral': 725, 'n_tokens_neox': 699, 'n_words': 136}