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

Can't Save PDF #69

Open
hudeaki opened this issue Jul 22, 2022 · 1 comment
Open

Can't Save PDF #69

hudeaki opened this issue Jul 22, 2022 · 1 comment

Comments

@hudeaki
Copy link

hudeaki commented Jul 22, 2022

I use code fo insert image from url but can't save to pdf

PDFAnnotate.prototype.addImageToServer = function () {
var inst = this;
var canvas = inst.fabricObjects[inst.active_canvas]

fabric.util.loadImage('https://d1hdtc0tbqeghx.cloudfront.net/sites/536207e0e52e306190000002/theme/images/sd-laravel-icon.png', function(img) {
if(img == null) {
alert("Error!");
}else {
var image = new fabric.Image(img);
canvas.add(image).setActiveObject(image);
canvas.renderAll();
}
}, { crossOrigin: 'anonymous' });

}

@hudeaki
Copy link
Author

hudeaki commented Jul 22, 2022

Or this code insert image finish but can't save pdf

PDFAnnotate.prototype.addImageToServer = function () {
var inst = this;
var canvas = inst.fabricObjects[inst.active_canvas]

fabric.Image.fromURL('https://d1hdtc0tbqeghx.cloudfront.net/sites/536207e0e52e306190000002/theme/images/sd-laravel-icon.png', function(oImg) {

// scale image down, and flip it, before adding it onto canvas
oImg.scale(0.5).set('flipX', true);
canvas.add(oImg);
});
}

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

1 participant