Recent

Author Topic: [Solved] Set margins into TRichmemo component ?  (Read 790 times)

rretamar

  • New Member
  • *
  • Posts: 39
[Solved] Set margins into TRichmemo component ?
« on: October 05, 2023, 12:36:00 am »
Hi.
I test a small app with TRichmemo component, and save content to RTF file, but can't configure page margins before save to file. I view component properties, but can't find any properties for setting page margins. The RTF format supporth margins, i test this using LibreOffcice.

Any idea ?

Thanks, Ramon  :)
« Last Edit: October 06, 2023, 05:06:08 pm by rretamar »

rretamar

  • New Member
  • *
  • Posts: 39
Re: Set margins into TRichmemo component ?
« Reply #1 on: October 06, 2023, 05:05:49 pm »
Estuve revisando el componente TKmemo pero a la hora de mostrar los RTF (que tienen cierta complejidad en el contenido, no son sólo texto) tengo ciertos elementos que no se ven correctamente y en el Richmemo sí.

Al final lo solucioné agregando las marcas con los valores de los márgenes dentro del contenido del rtf ants de guardar el documento, y funcionó perfecto, por ejemplo un valor de 300 "twips" para los 4 márgenes lo hago insertando estas marcas:

\margl300\margr300\margt300\margb300

Me ayudó mucho el libro online "The RTF Cookbook":

https://metacpan.org/dist/RTF-Writer/view/lib/RTF/Cookbook.pod#Document_Formatting

Ya voy a armar un post explicando cómo convertir ese RTF em PDF usando LibreOffice desde la línea de comandos.

Saludos y gracias.

 

TinyPortal © 2005-2018