Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I would like to adjust the div container of svg jsbarcode and the svg jsBarcode will follow the size of the div container #192

Closed
isaac0310 opened this issue Oct 3, 2017 · 2 comments

Comments

@isaac0310
Copy link

CSS of div

.internal_box{
		position: relative;
		display: inline-block;
		border: 1px solid;
		resize: both;
		overflow: auto;
	}

HTML SVG jsBarcode
<div class='internal_box'><svg id='p_barcode'></svg></div>

JQUERY

<script type="text/javascript">
	JsBarcode("#p_barcode").options(
	{margin: 0,
	height: 50,
	width: 1,
	font:"OCR-B",
	ratio:0.8}
	).EAN13("<?php echo $_GET['get_bar'];?>", 
	{fontSize: 18, textMargin: -1}).render();
	</script>

image

@isaac0310
Copy link
Author

Sorry for this question. I already got the answer
CSS

.internal_box{
		position: relative;
		border: 1px solid;
		display: inline-block;
		resize: both;
		overflow: auto;
	}

HTML
<div class='internal_box'><svg id='p_barcode' style='height: 100%;width: 100%'></svg></div>
JQUERY

<script type="text/javascript">
	JsBarcode("#p_barcode").options(
	{margin: 10,
	height: 100,
	width: 2,
	font:"OCR-B",
	ratio:0.8}
	).EAN13("<?php echo $_GET['get_bar'];?>", 
	{fontSize: 18, textMargin: -1}).render();
	</script>

image

@lindell lindell closed this as completed Oct 5, 2017
@albertkim
Copy link

@isaac0310 Thank you for posting your solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants