我使用rghost-barcode生成阿茲臺克人條形碼。但每次創建條形碼時,都會將其保存在A4頁面上,條形碼位於左上角。如何僅使用rghost將條形碼存儲爲.png而不是A4頁面?
這是怎麼發生的?如何將條形碼僅保存到具有所需尺寸(720px x 720px)的尺寸的PNG中。
這裏就是我目前正試圖:
doc = RGhost::Document.new
doc.barcode_azteccode('This is Aztec Code',{:text=>{:size=>8}, :format=>"full"})
doc.render :png, :resolution => 100, :filename => "my_barcode.png"
這是結果:
您可以在初始化時更改文檔大小嗎? – tadman