Add a Signature to a Report

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Red2
Posts: 271
Joined: Sat May 18, 2019 2:11 pm
DBs Used: Visual FoxPro, FoxPro
Location: United States of America

Add a Signature to a Report

Post by Red2 »

Hi All,

I have an HMG report (excerpt below). Here a .PNG of a complicated form ("RptPg_1") displays in the report's background.
It is like a full-page watermark.

The issue:
I attempt to add a signature "PICTURE" (see "FormSig") transparently over the form's signature block. ("FormSig" is also a .PNG).

I have not been able to apply only image's the "signature" portion without the white "background" portion overwriting its area of the form. The "signature" is not overlayed transparently.

Question:
In an HMG report can a signature be transparently added on top of an image below it?

Code: Select all

DEFINE REPORT Page_1
	PAPERSIZE	PRINTER_PAPER_LETTER    // 215.9  by  279.4
	
	BEGIN LAYOUT 
		ORIENTATION	PRINTER_ORIENT_PORTRAIT 
	END LAYOUT

	BEGIN HEADER
		BANDHEIGHT	0
	END HEADER

	BEGIN PICTURE
		VALUE	"RptPg_1"    // Entire form appears in page's background, like a big "watermark"
		ROW		0
		COL		0
		WIDTH	215.9
		HEIGHT	279.4
		STRETCH	.F.
	END PICTURE

	BEGIN DETAIL
		BANDHEIGHT	400

		BEGIN PICTURE
			VALUE	"FormSig"    // .PNG Signature
			ROW			203
			COL			45
			WIDTH		40
			HEIGHT		10
			Transparent .T.
			STRETCH		.F.
			ADJUSTIMAGE	.T.
			TRANSPARENTCOLOR {255,255,255}    //    {0,0,0}
		End Picture

	END DETAIL
END REPORT
Am I missing something? Is there a better way? Am I attempting the impossible?

I would really appreciate your kind guidance! Thank you.
EduardoLuis
Posts: 682
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina

Re: Add a Signature to a Report

Post by EduardoLuis »

Hi Red2

I dont use report function to create a report.
Since older version of HMG i choose HMGHPDF, it´s far away the best method to perform any kind of report or complex documents, and with the benefits of any PDF document.
If you take some time, take a look at the folder SAMPLES/HPDF/HMG_HPDF
It a sample, but enough to show you what you can do, specially mergin text, data, and any type of graphics.
Thats my suggestion.
Hope this helps you.
With regards.
Eduardo
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Add a Signature to a Report

Post by andyglezl »

Este ejemplo funciona ?
*-----------------------------------
Does this example work?

imagen_2021-07-12_215132.png
imagen_2021-07-12_215132.png (21.58 KiB) Viewed 5443 times

Ya revisaste la sintaxis de los ejemplos ?
*-------------------------------------------------------------------
You have already checked the syntax the examples ?

HMG\3.4.4\SAMPLES\Controls\ReportAdvanced\


Creo que una Imagen deberá de ir dentro de BEGIN HEADER / END HEADER
y la otra dentro de BEGIN FOOTER / END FOOTER
Andrés González López
Desde Guadalajara, Jalisco. México.
Red2
Posts: 271
Joined: Sat May 18, 2019 2:11 pm
DBs Used: Visual FoxPro, FoxPro
Location: United States of America

Re: Add a Signature to a Report

Post by Red2 »

Hi EduardoLuis and andyglezl,

Thank you for your kind guidance and observations.
  • I can confirm that this report syntax creates form document and programmatically fills in the relevant information.
    My report was adapted from, "C:\HMG.3.4.4\SAMPLES\Controls\ReportAdvanced\REPORT_ADVANCED_1\Demo.PRG".
    The (simplified) posted code excerpt was extracted from my actual .PRG.
    This report has run flawlessly since 2020.
The Issue:
If I print the report to a .PDF, instead of to paper, the document is not complete. It lacks a signature. It cannot be electronically submitted "as is".

I originally tried to also utilize HMGHPDF sample code. As I recall I could not figure out how to add the full-page background form image. In my inexperience and haste did I miss how to include it?

My Question:
In any case, is there some way to add a transparent signature over the background form image without obscuring the form area below it?

Thanks again. I very much appreciate you generous expertise and advice.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Add a Signature to a Report

Post by andyglezl »

Red2 wrote: Tue Jul 13, 2021 2:19 pm ----
The (simplified) posted code excerpt was extracted from my actual .PRG.
...
imagen_2021-07-13_113556.png
imagen_2021-07-13_113556.png (199.13 KiB) Viewed 5363 times

Lo siento, tu ejemplo no es funcional como para probarlo..
*-----------------------------------------------------------------------------
Sorry, your example is not functional to test.
Andrés González López
Desde Guadalajara, Jalisco. México.
Red2
Posts: 271
Joined: Sat May 18, 2019 2:11 pm
DBs Used: Visual FoxPro, FoxPro
Location: United States of America

Re: Add a Signature to a Report

Post by Red2 »

Hola andyglezl,

Thank you for the kind and very prompt reply. I really appreciate it! When printing without a signature onto paper HMG has been perfect. So far so good.

The simplified report code excerpt in my original post was to illustrate the goal. Add a transparent signature on top of an external (background full-page form) image.

My Goal:
It would be so useful to eliminate 1) printing a paper copy, 2) signing a signature with a pen, and 3) manually scanning the paper copy into the .PDF document necessary for electronic submission. Why not create the .PDF directly?

The Challenge as I see it:
Can HMG somehow create a report where a signature (an image) transparently appears over a external (background full-page form) image? Here the signature's "empty" background must not obscure any of the the external (background full-page form) image area. Possible?

If useful I can create a ready to run .PRG report example to demonstrate that the signature image is opaque.

Thanks again for your gracious guidance and expertise.
===================================================
(Google Translate):
Gracias por la amable y rápida respuesta. ¡Realmente lo aprecio! Al imprimir sin firma en papel, HMG ha sido perfecto. Hasta aquí todo bien.

El extracto del código de informe simplificado en mi publicación original fue para ilustrar el objetivo. Agregue una firma transparente encima de una imagen externa (formulario de página completa de fondo).

Mi meta:
Sería muy útil eliminar 1) imprimir una copia en papel, 2) firmar una firma con un bolígrafo y 3) escanear manualmente la copia en papel en el documento .PDF necesario para el envío electrónico. ¿Por qué no crear el .PDF directamente?

El desafío como yo lo veo:
¿Puede HMG crear de alguna manera un informe en el que una firma (una imagen) aparezca de forma transparente sobre una imagen externa (formulario de fondo de página completa)? Aquí, el fondo "vacío" de la firma no debe ocultar el área de la imagen externa (formulario de fondo de página completa). ¿Posible?

Si es útil, puedo crear un ejemplo de informe .PRG listo para ejecutar para demostrar que la imagen de la firma es opaca.

Gracias de nuevo por su amable orientación y experiencia.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Add a Signature to a Report

Post by andyglezl »

Si ya te funciona, cual sería el problema de que tu imagen externa ya lleve la firma en ella ?
Así solo manejas 1 imagen... y lo generas a PDF
*------------------------------------------------------------------------------------------------------------------
If it already works for you, what would be the problem if your external image already has the signature on it?
So you only handle 1 image ... and you generate it to PDF



ExecuteReport ( <cReportName> , <lPrintPreview> , <lSelectPrinter> , [ <cOutputFile> ] )

PDF Output:
- If <cOutputFile> with 'pdf' extension is specified, a PDF file with report
content will be generated. <lPrintPreview> and <lSelectPrinter> parameters
will be ignored).
Andrés González López
Desde Guadalajara, Jalisco. México.
Red2
Posts: 271
Joined: Sat May 18, 2019 2:11 pm
DBs Used: Visual FoxPro, FoxPro
Location: United States of America

Re: Add a Signature to a Report

Post by Red2 »

Hola andyglezl,

Thank you for your kind response. You ask a very reasonable and rational question.

Hard-coding a specific signature into a specific background form image has been my forced "make do". Yes, this "works" for one single instance as you suggest. However, an inflexible work-around such as this does not scale well. It is certainly not an elegant solution. Am I over-reaching?

Does anyone know if, in HMG or HMG Extended, it is even possible to overlay just a signature's pen strokes over a background form image? Can you more experienced HMG/Harbour veterans rule this possibility in or out? This is certainly the fundamental question.

Once again a big thank you to everyone for your expertise and thoughts.

===============================
Google Translation
===============================

Gracias por su amable respuesta. Haces una pregunta muy razonable y racional.

Codificación dura Una firma específica en una imagen de formulario de fondo específica ha sido mi "maquillaje" forzado ". Sí, esto "funciona" para una sola instancia como sugiere. Sin embargo, un trabajo inflexible, como esto, no se escala bien. Ciertamente no es una solución elegante. ¿Estoy muy alcanzando?

¿Alguien sabe si, en HMG o HMG, se extiende, incluso es posible superponerse solo a los trazos de la pluma de la firma sobre una imagen de formulario de fondo? ¿Puede usted más experimentado, los veteranos HMG / Harbor gobiernan esta posibilidad dentro o fuera? Esta es ciertamente la pregunta fundamental.

Una vez más, un gran agradecimiento a todos por su experiencia y pensamientos.
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Add a Signature to a Report

Post by AUGE_OHR »

hi,
Red2 wrote: Tue Jul 13, 2021 8:43 pm Does anyone know if, in HMG or HMG Extended, it is even possible to overlay just a signature's pen strokes over a background form image? Can you more experienced HMG/Harbour veterans rule this possibility in or out? This is certainly the fundamental question.
have you try to "overlay" Image with Image with "normal" Code ?

as i know it will not work while "transparency" is not what you "think" ...
it is only 1st. Pixel in upper/left to "identify" ...

---

under Xbase++ i can "mix" 2 Image in DC and use Ownerdraw to "paint" it
TAXI_Aninmation.gif
TAXI_Aninmation.gif (1.15 MiB) Viewed 5326 times
have a look at "Window" of "Taxi". you will see Background when it move
i don´t know how to do it under harbour / HMG yet
have fun
Jimmy
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Add a Signature to a Report

Post by andyglezl »

Si intentas con...
*-----------------------
If you try with ...

\HMG\3.4.4\SAMPLES\Controls\Print\Print_to_PDF

imagen_2021-07-13_164947.png
imagen_2021-07-13_164947.png (79.2 KiB) Viewed 5325 times
Andrés González López
Desde Guadalajara, Jalisco. México.
Post Reply