This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CSS Color Names | |
// Compiled by @bobspace. | |
// | |
// A javascript array containing all of the color names listed in the CSS Spec. | |
// The full list can be found here: http://www.w3schools.com/cssref/css_colornames.asp | |
// Use it as you please, 'cuz you can't, like, own a color, man. | |
var CSS_COLOR_NAMES = ["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","Darkorange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jsPDF from 'jspdf' | |
export default pdf({data, headers, filename}) { | |
const doc = new jsPDF() | |
doc.save(filename) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useState} from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import pdf from './utils/pdf' | |
function App() { | |
const [searching, setSearching] = useState(false) | |
const [movieList, setMovieList] = useState([]) | |
const [searchText, setSearchText] = useState('') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jsPDF from 'jspdf' | |
export default pdf({data, headers, filename}) { | |
const doc = new jsPDF({ | |
orientation: 'l', | |
unit: 'pt', | |
format: 'a4' | |
}) | |
doc.save(filename) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jsPDF from 'jspdf' | |
export default pdf({data, headers, filename}) { | |
const doc = new jsPDF({...}) | |
const pageDimensions = { // NEW CODE | |
height: 595.28, | |
width: 841.89 | |
} | |
doc.save(filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jsPDF from 'jspdf' | |
export default pdf({data, headers, filename}) { | |
const doc = new jsPDF({...}) | |
const pageDimensions = {...} | |
const pageMargin = 50 // NEW CODE | |
// NEW CODE | |
const liveArea = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jsPDF from 'jspdf' | |
export default function({data, headers, filename}) { | |
const doc = new jsPDF({...}) | |
const pageDimensions = {...} | |
const pageMargin = 50 | |
const liveArea = {...} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jsPDF from 'jspdf' | |
export default function({data, headers, filename}) { | |
const doc = new jsPDF({...}) | |
{... I cut out previous code for brevity but it belongs here!} | |
const xPositions = [] // NEW CODE | |
// NEW CODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jsPDF from 'jspdf' | |
export default function({data, headers, filename}) { | |
const doc = new jsPDF({...}) | |
{... I cut out previous code for brevity but it belongs here!} | |
// NEW CODE | |
doc.line(pageMargin, pageMargin + 3.5, liveArea.width , pageMargin + 3.5) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jsPDF from 'jspdf' | |
export default function({data, headers, filename}) { | |
const doc = new jsPDF({...}) | |
{... I cut out previous code for brevity but it belongs here!} | |
// NEW CODE | |
// ROWS | |
data.forEach((row, rIndex) => { |
OlderNewer