Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #13454

Re: print on dymo

From Franz Rachbauer <office@rachbauer.org>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: print on dymo
Date 2021-10-16 12:19 +0200
Organization Aioe.org NNTP Server
Message-ID <ske8v3$mf0$1@gioia.aioe.org> (permalink)
References <8dae9e44-8d1f-4d55-b4fd-33ca652b4c89n@googlegroups.com>

Show all headers | View raw


Hi Aurora,
I'm printing Barcode labels directly to the printer. I define a template 
with a simple Texteditor containing some placeholders (#TXT#, #EAN#, ..) 
which I replace before printing:
Franz

// Build finished label
PROCEDURE PrintLabel(	cPrinter AS STRING,;
			cLabel AS STRING,;
			cTxt AS STRING,;
			cArtnr AS STRING,;
			cEan AS STRING,;
			nVkp AS FLOAT)

	LOCAL cVal AS STRING

	// Read template
	cVal := MemoRead(cLabel)
	
	// Replace placeholders	
	cVal := StrTran(cVal, "#TXT#", AllTrim(cTxt))
	cVal := StrTran(cVal, "#ARTNR#", AllTrim(cArtnr))
	cVal := StrTran(cVal, "#EAN#", AllTrim(cEan))
	cVal := StrTran(cVal, "#VKP#", Str(nVkp,7,2))

	// Print to windows printer
	WriteData2Printer(cPrinter, cVal)
	RETURN

// Print function I got somethere from usergroup
FUNCTION WriteData2Printer (cPrinter AS STRING,;
	cData AS STRING) AS LOGIC PASCAL

	LOCAL lResult    AS LOGIC
	LOCAL hPrinter   AS PTR
	LOCAL pszPrinter AS PSZ
	LOCAL pBuffer    AS PTR
	LOCAL dwWritten  AS DWORD
	LOCAL pDocInfo   IS _winDoc_Info_1
	LOCAL pPtrDflts  IS _WINPRINTER_DEFAULTS

	lResult := FALSE
	pszPrinter := StringAlloc(cPrinter + _CHR(0))
	IF OpenPrinter(pszPrinter, @hPrinter, @pPtrDflts )  // NULL
		pBuffer := StringAlloc(cData + _CHR(0))
		pDocInfo.pDocName    := String2Psz("PrinterSpooler Document")
		pDocInfo.pOutPutFile := NULL_PSZ  // String2Psz (NULL_STRING)
		pDocInfo.pDatatype   := String2Psz ("RAW")
		IF StartDocPrinter(hPrinter, 1, @pDocInfo) <> 0
			IF WritePrinter(hPrinter, pBuffer, SLen(cData), @dwWritten)
				IF dwWritten == SLen(cData)
					lResult := TRUE
				ENDIF
			ELSE
				dwWritten := GetLastError()
			ENDIF
			EndDocPrinter(hPrinter)
		ELSE
			dwWritten := GetLastError()
		ENDIF
		ClosePrinter(hPrinter)
		MemFree(pBuffer)
	ELSE
		dwWritten := GetLastError()
	ENDIF
	MemFree(pszPrinter)
	RETURN lResult

Am 15.10.2021 um 16:04 schrieb aurora baccio:
> good morning
> I need to create a label to print on a dymo 450.
> Currently I use word, but it becomes more and more complex when printing.
> How can I create a text file for the dymo to print? The size of the label to be printed is three centimetres wide by five centimetres high.
> I was able to find the horizontal x five cm labels, but I can't create the file to send to the dymo printer.
> thanks
> Aurora Baccio
> 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

print on dymo aurora baccio <aurorabaccio@gmail.com> - 2021-10-15 07:04 -0700
  Re: print on dymo "Wolfgang Riedmann" <wriedmann@gmail.com> - 2021-10-15 17:13 +0200
    Re: print on dymo Phil McGuinness <sherlocksoftware@gmail.com> - 2021-10-15 23:29 -0700
  Re: print on dymo Franz Rachbauer <office@rachbauer.org> - 2021-10-16 12:19 +0200

csiph-web