{"action":"created","issue":{"url":"https://api.github.com/repos/edabg/jsprintsetup/issues/29","repository_url":"https://api.github.com/repos/edabg/jsprintsetup","labels_url":"https://api.github.com/repos/edabg/jsprintsetup/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/edabg/jsprintsetup/issues/29/comments","events_url":"https://api.github.com/repos/edabg/jsprintsetup/issues/29/events","html_url":"https://github.com/edabg/jsprintsetup/issues/29","id":191797118,"number":29,"title":"JsPrint margin and scaling issue","user":{"login":"surabhiv","id":24150492,"avatar_url":"https://avatars.githubusercontent.com/u/24150492?v=3","gravatar_id":"","url":"https://api.github.com/users/surabhiv","html_url":"https://github.com/surabhiv","followers_url":"https://api.github.com/users/surabhiv/followers","following_url":"https://api.github.com/users/surabhiv/following{/other_user}","gists_url":"https://api.github.com/users/surabhiv/gists{/gist_id}","starred_url":"https://api.github.com/users/surabhiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surabhiv/subscriptions","organizations_url":"https://api.github.com/users/surabhiv/orgs","repos_url":"https://api.github.com/users/surabhiv/repos","events_url":"https://api.github.com/users/surabhiv/events{/privacy}","received_events_url":"https://api.github.com/users/surabhiv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-26T09:44:57Z","updated_at":"2016-11-28T07:45:56Z","closed_at":null,"body":"Hello,\r\n  I have used js print for printing customization.It works well for orientation but my code not working for margin.I have set all margins zero and also set browser's  margin zero,still it takes default margins.Please give me any solution for it.Here is code for A5 landscape.\r\n\r\n<html>\r\n <head>\r\n  <title>Printing</title>\r\n  <style>\r\n  *{ box-sizing:border-box;}\r\n  body \r\n  {\r\n  \tfont-family:verdana,arial;\r\n  \tfont-size:10pt;\r\n  \tbackground:white;\r\n  \t} \r\n\r\n  div\r\n  {\r\n  \twidth:100%;border:3px solid black;\r\n  \tpadding:3px;\r\n  }\r\n \r\n  </style>\r\n  <script type=\"text/javascript\">\r\n  function print_ex()\r\n  {\r\n  \t\r\n\t\tjsPrintSetup.setOption('orientation',jsPrintSetup.kLandscapeOrientation);\r\n\t\t// set top margins in millimeters\r\n\r\n\t\tjsPrintSetup.definePaperSize(101,101, \"Custom\", \"Custom_Paper\", \"Custom PAPER\",148,210,jsPrintSetup.kPaperSizeMillimeters);\r\n\t\tjsPrintSetup.setPaperSizeData(101);\r\n\t\t//jsPrintSetup.setOption('paperData',11);\r\n\t\t\r\n\t\t\r\n\t\tjsPrintSetup.setOption('marginTop',0);\r\n\t\tjsPrintSetup.setOption('marginBottom',0);\r\n\t\tjsPrintSetup.setOption('marginLeft',0);\r\n\t\tjsPrintSetup.setOption('marginRight',0);\r\n\r\n\t\tjsPrintSetup.setOption('unwriteableMarginTop',0);\r\n\t\tjsPrintSetup.setOption('unwriteableMarginLeft',0);\r\n\t\tjsPrintSetup.setOption('unwriteableMarginBottom',0);\r\n\t\tjsPrintSetup.setOption('unwriteableMarginRight',0);\r\n\r\n\t\t\r\n\t\t// set page header\r\n\t\tjsPrintSetup.setOption('headerStrLeft','My custom header');\r\n\t\tjsPrintSetup.setOption('headerStrCenter', '');\r\n\t\tjsPrintSetup.setOption('headerStrRight', '&PT');\r\n\t\t// set empty page footer\r\n\t\t// jsPrintSetup.setOption('footerStrLeft', '');\r\n\t\t// jsPrintSetup.setOption('footerStrCenter', '');\r\n\t\t// jsPrintSetup.setOption('footerStrRight', '');\r\n\t\t// Suppress print dialog\r\n\t\tjsPrintSetup.setSilentPrint(true);/** Set silent printing */\r\n\t\tjsPrintSetup.saveOptions(true);\r\n\t\t// Do Print\r\n\t\tjsPrintSetup.print();\r\n\t\t// Restore print dialog\r\n\t\tjsPrintSetup.setSilentPrint(false); /** Set silent printing back to false */\r\n\r\n\t\talert(\"test data1\");\r\n \r\n  }\r\n </script>\t \r\n </head>\r\n <body>\r\n <center>\r\n <div>\r\n Print Example ...<br/>\r\n This is example1<br/>\r\n This is example2<br/>\r\n This is example3<br/>\r\n This is example4<br/>\r\n <br/><br/>\r\n \r\n </div>\r\n \r\n <input type=\"button\" value=\"Print Now\" onClick=\"print_ex();\"/>\r\n </center>\r\n </body>\r\n </html> "},"comment":{"url":"https://api.github.com/repos/edabg/jsprintsetup/issues/comments/263203618","html_url":"https://github.com/edabg/jsprintsetup/issues/29#issuecomment-263203618","issue_url":"https://api.github.com/repos/edabg/jsprintsetup/issues/29","id":263203618,"user":{"login":"mitkola","id":11041032,"avatar_url":"https://avatars.githubusercontent.com/u/11041032?v=3","gravatar_id":"","url":"https://api.github.com/users/mitkola","html_url":"https://github.com/mitkola","followers_url":"https://api.github.com/users/mitkola/followers","following_url":"https://api.github.com/users/mitkola/following{/other_user}","gists_url":"https://api.github.com/users/mitkola/gists{/gist_id}","starred_url":"https://api.github.com/users/mitkola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitkola/subscriptions","organizations_url":"https://api.github.com/users/mitkola/orgs","repos_url":"https://api.github.com/users/mitkola/repos","events_url":"https://api.github.com/users/mitkola/events{/privacy}","received_events_url":"https://api.github.com/users/mitkola/received_events","type":"User","site_admin":false},"created_at":"2016-11-28T07:45:55Z","updated_at":"2016-11-28T07:45:55Z","body":"If you are using standard paper sizes (in jsPrintSetup), the recommended way is to use them. For example for iso A5 this is paper id 11.(https://github.com/edabg/jsprintsetup/wiki#enhanced-paper-data-handling)\r\nI have attached an example which print without any margins.\r\n```html\r\n<html>\r\n  <head>\r\n\t<title>Printing</title> \r\n<style> \r\n* {\r\n\tbox-sizing:border-box;\r\n} \r\nbody {\r\n\tfont-family:verdana,arial; \r\n\tfont-size:10pt; \r\n\tbackground:white;\r\n\tmargin: 0px; \r\n}\r\ndiv {\r\n\twidth:100%;border:3px solid black;\r\n\tpadding:3px;\r\n}\r\n</style> <script type=\"text/javascript\"> \r\nfunction print_ex() {\r\n\r\n\tjsPrintSetup.setGlobalOption('DEBUG', true);\r\n\tjsPrintSetup.setPrinter('PDFCreator');\r\n\r\n\tjsPrintSetup.setPaperSizeData(11); // iso_a5\r\n\tjsPrintSetup.setOption('orientation',jsPrintSetup.kLandscapeOrientation);\r\n\r\n\t// unwriteable margins\r\n\tjsPrintSetup.setOption('unwriteableMarginTop',0);\r\n\tjsPrintSetup.setOption('unwriteableMarginLeft',0);\r\n\tjsPrintSetup.setOption('unwriteableMarginBottom',0);\r\n\tjsPrintSetup.setOption('unwriteableMarginRight',0);\r\n\t// The edge measurements define the positioning of the headers and footers on the page. \r\n\t// They're measured as an offset from the \"unwriteable margin\".\r\n\tjsPrintSetup.setOption('edgeTop',0);\r\n\tjsPrintSetup.setOption('edgeBottom',0);\r\n\tjsPrintSetup.setOption('edgeLeft',0);\r\n\tjsPrintSetup.setOption('edgeRight',0);\r\n\t\r\n\t// set top margins in millimeters\r\n\tjsPrintSetup.setOption('marginTop',0);\r\n\tjsPrintSetup.setOption('marginBottom',0);\r\n\tjsPrintSetup.setOption('marginLeft',0);\r\n\tjsPrintSetup.setOption('marginRight',0);\r\n\r\n\t// set empty page header\r\n\tjsPrintSetup.setOption('headerStrLeft','');\r\n\tjsPrintSetup.setOption('headerStrCenter', '');\r\n\tjsPrintSetup.setOption('headerStrRight', '');\r\n\t// set empty page footer\r\n\tjsPrintSetup.setOption('footerStrLeft', '');\r\n\tjsPrintSetup.setOption('footerStrCenter', '');\r\n\tjsPrintSetup.setOption('footerStrRight', '');\r\n\t\r\n\t// Suppress print dialog\r\n\tjsPrintSetup.clearSilentPrint();\r\n\tjsPrintSetup.setSilentPrint(true);/** Set silent printing */\r\n\t// Do Print\r\n\tjsPrintSetup.print();\r\n\t// Restore print dialog\r\n\tjsPrintSetup.setSilentPrint(false); /** Set silent printing back to false */\r\n}\r\n</script>\r\n  </head>\r\n  <body onClick=\"print_ex()\" style=\"border: 1px solid black;\">\r\nPrint Example ...<br />\r\nThis is example1<br />\r\nThis is example2<br />\r\nThis is example3<br />\r\nThis is example4<br />\r\n  </body>\r\n</html>\r\n```"}}
{"actor":{"display_login":"mitkola"}}