0

Could you please give me at least one example of how I can print some data in the document in callbacks with pdf.print or please help me how I can insert information in any part of the document during callbacks? For example,how I can print something using finish_pdfpage callback? Thanks everybody for the help.

  • Does https://tex.stackexchange.com/questions/70/what-is-a-simple-example-of-something-you-can-do-with-luatex help? – JPi Mar 18 '19 at 00:39
  • @JPi tex.printpdf.print – Henri Menke Mar 18 '19 at 01:11
  • 2
    It is very important what you want to print with pdf.print. You probably want to use pdf.immediateobj. – Henri Menke Mar 18 '19 at 01:23
  • I want to print text in page_content of pdf document,when i catch callbacks,but i dont find any example,how correct to do it,because all my attempts not give any result for me. Thanks everybody for the help. – Aleksandr Kozlovskiy Mar 18 '19 at 15:53
  • In my example actualtext not added to the document,even when i tryed use pdf.print function. I next comment you will see example of my document,which not works for me. Help me please solve my problem and thanks everybody for the help. – Aleksandr Kozlovskiy Mar 20 '19 at 15:35
  • \documentclass{article} \usepackage{luacode} \usepackage{polyglossia} \setmainlanguage[babelshorthands=true]{russian} \setmainfont{Times New Roman} \pagestyle{empty} \thispagestyle{empty} \begin{luacode} pdf.setcompresslevel(0) b=0 function f(a) texio.write_nl("Value "..a) if a=="new_graf" then if b%2==0 then pdf.immediateobj("/Span <</ActualText (test)>> BDC") else pdf.immediateobj("EMC") end b=b+1 end end luatexbase.add_to_callback("buildpage_filter",f,"filter") \end{luacode} \begin{document} paragraph one

    paragraph two \end{document}

    – Aleksandr Kozlovskiy Mar 20 '19 at 15:39
  • \documentclass{article} \usepackage{luacode} \usepackage{polyglossia} \setmainlanguage[babelshorthands=true]{russian} \setmainfont{Times New Roman} \pagestyle{empty} \thispagestyle{empty} \begin{luacode} pdf.setcompresslevel(0) b=0 function f(a) texio.write_nl("Value "..a) if a=="new_graf" then if b%2==0 then pdf.immediateobj("/Span <</ActualText (test)>> BDC") else pdf.immediateobj("EMC") end b=b+1 end end luatexbase.add_to_callback("buildpage_filter",f,"filter") \end{luacode} \begin{document} paragraph one

    paragraph two

    \end{document}

    – Aleksandr Kozlovskiy Mar 20 '19 at 17:19

0 Answers0