-
Notifications
You must be signed in to change notification settings - Fork 422
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
Extended POC for images. #84
base: master
Are you sure you want to change the base?
Conversation
… keys method more defensive
fixing multiple images, keys method and adding row height config
merge with base
Example of how I am using this: function _get_logo(logo_path){
var bitmap = fs.readFileSync(logo_path);
var scale = 1.2;
var heightEMU = _inch2emu(.63, scale);
var widthEMU = _inch2emu(1.15, scale);
var heightOff = _inch2emu(.07, scale);
var widthOff = _inch2emu(.672 , (1/scale));
return [
{
name: 'logo.png',
data: new Buffer(bitmap).toString('base64'),
opts: { base64: true },
attrs: { editAs: 'absolute' },
type: 'png',
spPr: {
xfrm: {
off: { x: 0, y: 0 },
ext: { cx: widthEMU, cy: heightEMU, }
}
},
position: {
type: 'twoCellAnchor',
from: { col: 0, row : 1 , colOff: widthOff, rowOff: heightOff},
to: { col: 0, row : 4 , colOff: widthEMU + widthOff, rowOff: heightEMU + heightOff}
}
}
]
} |
hello im using your example but i getting this error when trying to open the file
|
You don't get the error if you take out the part with the images? The shape (
|
This is what I use:
|
thanks already find it
2017-11-03 9:20 GMT-07:00 geoff golder <[email protected]>:
… This is what I use:
function _inch2emu(inch, scale){
scale = scale || 1;
return Math.floor(scale * inch * 914400);
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#84 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AIIU9fbH92ra-IPGtVONH29bOIryHidnks5syz1pgaJpZM4PC1sm>
.
--
Jesus Fregoso
Web Developer, Triples Soluciones
Móvil: 6692184214
Dirección: Mazatlan, Sinaloa
Email: [email protected] <[email protected]>
[image: Facebook] <https://www.facebook.com/jessFregoso0>
[image: Linkedin] <https://www.linkedin.com/in/jesus-fregoso-osuna-57b06ba5>
|
style the same error :/ i guest i have to keep looking about it
2017-11-03 9:24 GMT-07:00 Jesus Fregoso <[email protected]>:
… thanks already find it
2017-11-03 9:20 GMT-07:00 geoff golder ***@***.***>:
> This is what I use:
>
> function _inch2emu(inch, scale){
> scale = scale || 1;
> return Math.floor(scale * inch * 914400);
> }
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#84 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AIIU9fbH92ra-IPGtVONH29bOIryHidnks5syz1pgaJpZM4PC1sm>
> .
>
--
Jesus Fregoso
Web Developer, Triples Soluciones
Móvil: 6692184214
Dirección: Mazatlan, Sinaloa
Email: ***@***.*** ***@***.***>
[image: Facebook] <https://www.facebook.com/jessFregoso0>
[image: Linkedin]
<https://www.linkedin.com/in/jesus-fregoso-osuna-57b06ba5>
--
Jesus Fregoso
Web Developer, Triples Soluciones
Móvil: 6692184214
Dirección: Mazatlan, Sinaloa
Email: [email protected] <[email protected]>
[image: Facebook] <https://www.facebook.com/jessFregoso0>
[image: Linkedin] <https://www.linkedin.com/in/jesus-fregoso-osuna-57b06ba5>
|
Windows only, but HIGHLY recommended if you are trying to debug openxml https://www.microsoft.com/en-us/download/details.aspx?id=30425 You want the open xml productivity tool; it will give you much, much better errors than what excel gives you. |
i already solve thank you for the tips :D
2017-11-03 9:33 GMT-07:00 geoff golder <[email protected]>:
… Windows only, but HIGHLY recommended if you are trying to debug openxml
https://www.microsoft.com/en-us/download/details.aspx?id=30425
You want the open xml productivity tool; it will give you much, much
better errors than what excel gives you.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#84 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AIIU9bFeNcl3tJZbmfd8ocqWd1faGOOHks5sy0BNgaJpZM4PC1sm>
.
--
Jesus Fregoso
Web Developer, Triples Soluciones
Móvil: 6692184214
Dirección: Mazatlan, Sinaloa
Email: [email protected] <[email protected]>
[image: Facebook] <https://www.facebook.com/jessFregoso0>
[image: Linkedin] <https://www.linkedin.com/in/jesus-fregoso-osuna-57b06ba5>
|
Here is my code but i don't know why i am not able to get the image in excel file. const input = document.getElementById("Demodata"); Anybody please help me. |
|
It looks like you are missing these two fields on the root of the object
|
This is a slight improvement in that it also allows offsetting and setting the image size.