GithubHelp home page GithubHelp logo

Comments (3)

blackwood avatar blackwood commented on September 27, 2024

Can confirm, produces a file called "sheet.png" (which MacOS won't open) on my install too. Overriding with the "file" parameter on save_pdf method fixed it, but it was a little unintuitive after following the docs.

from squib.

joem avatar joem commented on September 27, 2024

I started looking into this a bit when I was bothered by it, and I haven't tried to fix it yet, but I think I traced the problem...

The save_pdf method comes from /lib/squib/dsl/save_pdf.rb which uses /lib/squib/graphics/save_pdf.rb and that uses sheet.full_filename which comes from /lib/squib/args/sheet.rb where it is defined as:

def full_filename(i=nil)
  if i.nil?
	"#{dir}/#{file}"
  else
	"#{dir}/#{prefix}#{count_format % i}#{suffix}.png"
  end
end

At no point is the .png ever overridden. I'm not certain off the top of my head what the best way to fix it would be, but I think a good way that doesn't touch too many files would be making the file extension be one of the properties of sheet, and it defaults to png but can be overridden during the Sheet#full_filename call. I believe that would just require editing /lib/squib/graphics/save_pdf.rb and /lib/squib/args/sheet.rb, and wouldn't affect anything else.

from squib.

joem avatar joem commented on September 27, 2024

Oops. Small update to what I just wrote: it's not actually the full_filename method. Instead I think it's this file parameter in /lib/squib/args/sheet.rb not being overridden:

file: 'sheet.png',

from squib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.