Hi.
I am using libHaru in a Lua Script (AutoPlay Media Studio). Everything is ok BUT I cannot use the command HPDF_Page_TextRect().
Ex:
require "hpdf"
local pdf = hpdf.New()
if pdf then
local page = hpdf.AddPage(pdf)
hpdf.Page_SetSize(page, HPDF_PAGE_SIZE_A4, HPDF_PAGE_PORTRAIT)
local height = hpdf.Page_GetHeight(page)
local width = hpdf.Page_GetWidth(page)
--Cabeçalho
local image = hpdf.LoadPngImageFromFile(pdf,"esquerda.png")
local image2 = hpdf.LoadPngImageFromFile(pdf,"direita.png")
hpdf.Page_DrawImage(page,image, 30, height - 100, 138, 50.5)
hpdf.Page_DrawImage(page,image2, width-30-140.5, height - 100, 140.5, 50,5)
--Identificação
local font = hpdf.GetFont(pdf, "Times-Bold", "WinAnsiEncoding")
hpdf.Page_SetFontAndSize(page, font, 12)
hpdf.Page_BeginText(page)
hpdf.Page_TextOut(page, 30, height - 250, "Processo:")
hpdf.Page_TextOut(page, 30, height - 275, "Interessado:")
hpdf.Page_EndText(page)
This works very well. Now, I will try to add a long text in a rectangle and justify it.
local ementa = "Esse é um texto muito específico e longo. Sua função é testar a funcionalidade de colocação de um texto justificado dentro de um determindo espaço de página. Vamos ver se funciona. Parece bom!";
hpdf.Page_TextRect(page,0,0,200,200,ementa,HPDF_TA LIGN_JUSTIFY,);
hpdf.Page_TextRect does not work. The IDE says that the 7th argument must be 'string'. This is a string. I tryed to change the place of arguments to hpdf.Page_TextRect(page,0,0,200,200,ementa,HPDF_TA LIGN_JUSTIFY,);
In this case the problem is in the 7th argument.
I think about compile libhpdf to the last version (2.3) but I gave up, I don't know how.
Any help?
Thsnks
I am using libHaru in a Lua Script (AutoPlay Media Studio). Everything is ok BUT I cannot use the command HPDF_Page_TextRect().
Ex:
require "hpdf"
local pdf = hpdf.New()
if pdf then
local page = hpdf.AddPage(pdf)
hpdf.Page_SetSize(page, HPDF_PAGE_SIZE_A4, HPDF_PAGE_PORTRAIT)
local height = hpdf.Page_GetHeight(page)
local width = hpdf.Page_GetWidth(page)
--Cabeçalho
local image = hpdf.LoadPngImageFromFile(pdf,"esquerda.png")
local image2 = hpdf.LoadPngImageFromFile(pdf,"direita.png")
hpdf.Page_DrawImage(page,image, 30, height - 100, 138, 50.5)
hpdf.Page_DrawImage(page,image2, width-30-140.5, height - 100, 140.5, 50,5)
--Identificação
local font = hpdf.GetFont(pdf, "Times-Bold", "WinAnsiEncoding")
hpdf.Page_SetFontAndSize(page, font, 12)
hpdf.Page_BeginText(page)
hpdf.Page_TextOut(page, 30, height - 250, "Processo:")
hpdf.Page_TextOut(page, 30, height - 275, "Interessado:")
hpdf.Page_EndText(page)
This works very well. Now, I will try to add a long text in a rectangle and justify it.
local ementa = "Esse é um texto muito específico e longo. Sua função é testar a funcionalidade de colocação de um texto justificado dentro de um determindo espaço de página. Vamos ver se funciona. Parece bom!";
hpdf.Page_TextRect(page,0,0,200,200,ementa,HPDF_TA LIGN_JUSTIFY,);
hpdf.Page_TextRect does not work. The IDE says that the 7th argument must be 'string'. This is a string. I tryed to change the place of arguments to hpdf.Page_TextRect(page,0,0,200,200,ementa,HPDF_TA LIGN_JUSTIFY,);
In this case the problem is in the 7th argument.
I think about compile libhpdf to the last version (2.3) but I gave up, I don't know how.
Any help?
Thsnks
Comment