christopherdro / react-native-print

Print documents using React Native
MIT License
335 stars 142 forks source link

Print gets blurry when I am trying print receipt on bluetooth printer #184

Closed Janviba911 closed 1 year ago

Janviba911 commented 1 year ago

I am using react-native-view-shot for snap and sent that uri to the react-native-print. Please check below code:

Version "react-native-print": "^0.6.0",

Code await print({ html: wrapHtmlforFileOuput({ content:`, type: 'image' }) });

export function wrapHtmlforFileOuput({ type = 'pdf', content = "", style = "" }: { type?: "pdf" | "image", content?: string, style?: string }): string { const finalHtml = ` <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">

${type === 'pdf' ? style : ``}
    <body style="-webkit-text-size-adjust: 100%; user-select: none;">
        ${content}
    </body>
</html>`;
return finalHtml;

}`

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.