Can you provide the script for replicating your issue, because I couldn't find the issue from your script?
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/fd4918b7-c7ef-4826-8c4e-41377ec732c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thank you for providing the script. I could confirm that your javascript is fine. I found a modification point of your Google Apps Script. About the method of "createFile()", when "blob" is used, please use as "createFile(blob)". So the modified script becomes as follows. Can you test this?
function saveImage(urlData) {
var imageData = Utilities.base64Decode(urlData);
var blob = Utilities.newBlob(imageData, MimeType.PNG).setName("signature");
var folder = DriveApp.getRootFolder();
var file = folder.createFile(blob);
}
|
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/615c2aeb-da16-46fe-bddd-dc55e58cc44b%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/294be8c2-0bbf-4645-a46e-440df9a8d169%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/a05826c5-a765-457c-96dd-4ad8ef89c1e1%40googlegroups.com.
Thanks, Clarkdid not solve
Em seg, 22 de abr de 2019 às 10:44, Clark Lind <cwl...@gmail.com> escreveu:
In looking into this further, the problem could be caused (I'm guessing) is, when a user manually downloads a chart as PNG, this conversion is being done on the server with server-side code. However, Google charts are rendered in the browser. So, similar to what was done above (Converting canvas image to png). So adding Kanshi's code from above to Marcos' code might look something like this?--(I will test and see if this makes any difference in my charts.)
function getChartToPNG() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var chartGroup = ss.getSheetByName("grafico_grupo");
var chart = chartGroup.getCharts()[0];
var imageData = Utilities.base64Decode(chart);
var blob = Utilities.newBlob(imageData, MimeType.PNG).setName("chart.png");
var folder = DriveApp.getFolderById(_folder_ID_);
folder.createFile(blob);
}
On Monday, April 22, 2019 at 8:37:10 AM UTC-4, Kanshi Tanaike wrote:Thank you for replying. I could understand about your issue. About this issue, I have no workarounds now. I apologize for my poor skill. If I found the workaround, I would like to report it. I apologize for this situation, again.
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
function getChartToPNG() { var ss = SpreadsheetApp.getActiveSpreadsheet();
var chartGroup = ss.getSheetByName("Sheet1"); var chart = chartGroup.getCharts()[0]; var slides = SlidesApp.create("sample"); var slide = slides.getSlides()[0]; var image = slide.insertSheetsChartAsImage(chart); DriveApp.createFile(image.getBlob()).setName("chart.png"); DriveApp.getFileById(slides.getId()).setTrashed(true);}
function getChartToPNG() {
var slides = SlidesApp.openById("**Slide ID**");
var slide = slides.getSlides()[0];
var charts = slide.getSheetsCharts();
var image = DriveApp.createFile(charts[0].asImage()).setName("chart.png");
//I use to auto-update a Sites Page:
var page = SitesApp.getPageByUrl('Old Sites URL');
var atch = page.getAttachments();
atch[0].setFrom(image);
}