Comments (6)
from react-dymo.
Hi @sarkis1997. After some research, I think that with the new printLabel
utility function is enough. With this function you have the "labelSetXml" param, with this param you can achieve the required behavior .
For example:
Note in the following example the "Address" id.
import {printLabel} from "react-dymo-hooks";
const printerName = "Some Printer Name"
const labelXml = `<?xml version="1.0" encoding="utf-8"?>
<DieCutLabel Version="8.0" Units="twips">
<PaperOrientation>Landscape</PaperOrientation>
<Id>Address</Id>
<IsOutlined>false</IsOutlined>
<PaperName>30336 1 in x 2-1/8 in</PaperName>
<DrawCommands>
<RoundRectangle X="0" Y="0" Width="1440" Height="3060" Rx="180" Ry="180" />
</DrawCommands>
<ObjectInfo>
<TextObject>
<Name>Address</Name>
<ForeColor Alpha="255" Red="0" Green="0" Blue="0" />
<BackColor Alpha="0" Red="255" Green="255" Blue="255" />
<LinkedObjectName />
<Rotation>Rotation0</Rotation>
<IsMirrored>False</IsMirrored>
<IsVariable>False</IsVariable>
<GroupID>-1</GroupID>
<IsOutlined>False</IsOutlined>
<HorizontalAlignment>Center</HorizontalAlignment>
<VerticalAlignment>Middle</VerticalAlignment>
<TextFitMode>ShrinkToFit</TextFitMode>
<UseFullFontHeight>True</UseFullFontHeight>
<Verticalized>False</Verticalized>
<StyledText>
<Element>
<Attributes>
<Font Family="Arial" Size="12" Bold="False" Italic="False" Underline="False" Strikeout="False" />
<ForeColor Alpha="255" Red="0" Green="0" Blue="0" HueScale="100" />
</Attributes>
</Element>
</StyledText>
</TextObject>
<Bounds X="130" Y="300" Width="2846" Height="720" />
</ObjectInfo>
</DieCutLabel>`
const labelSetXml = `<LabelSet><LabelRecord><ObjectData Name="Address">Address1</ObjectData></LabelRecord><LabelRecord><ObjectData Name="Address">Address2</ObjectData></LabelRecord></LabelSet>`
// Inside some component or any react function
printLabel(printerName, labelXml, labelSetXml)
I couldn't test this example with a real dymo printer, because right now I don't have a printer.
Some error or anything, I'm here.
from react-dymo.
from react-dymo.
from react-dymo.
from react-dymo.
Hi, Since I updated to version 2.0.1 I am getting this error: react.development.js:1465 Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app This is caused by: import { useDymoCheckService, useDymoFetchPrinters, useDymoOpenLabel, printLabel, } from "react-dymo-hooks”; const statusDymoService = useDymoCheckService(); const { statusFetchPrinters, printers } = useDymoFetchPrinters(); It is called inside a functional component. What is going wrong?
…
Op 22 okt. 2022, om 17:16 heeft Antonio Peña Batista @.***> het volgende geschreven: #33 <#33> — Reply to this email directly, view it on GitHub <#34 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIC55BOOEEHAXYHQZ5J2BDLWEQAORANCNFSM6AAAAAAREDCBYA. You are receiving this because you authored the thread.
Hi, the latest version of react-dymo-hooks is 2.0.2, I tested and all is working good, if you want share a code sandbox example.
from react-dymo.
Related Issues (15)
- Add function for print label HOT 9
- Bug with dymo web service HOT 2
- Printing blanks from Windows computer HOT 5
- Connection refused, CORS error HOT 3
- Less renders HOT 1
- Feature Request -- add non hook methods
- When trying to use useDymoCheckService I get "Uncaught Error: Invalid hook call." HOT 3
- Remove react-dom from dependencies
- Migrate to TypeScript all project
- Separate the core of DymoJs into an isolated package
- Remove usage of the "axios" library HOT 1
- Change from Webpack to Rollup for better module handler
- Emojis
- Enhance project HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-dymo.