Skip to content

Instantly share code, notes, and snippets.

@kevinmarvin
Created September 9, 2016 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinmarvin/1c9563af5d226af4882149a000d7eb53 to your computer and use it in GitHub Desktop.
Save kevinmarvin/1c9563af5d226af4882149a000d7eb53 to your computer and use it in GitHub Desktop.
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Aspose.Cell ">
<link rel=File-List href="null/filelist.xml">
<link rel=Edit-Time-Data href="null/editdata.mso">
<link rel=OLE-Object-Data href="null/oledata.mso">
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
</o:DocumentProperties>
</xml><![endif]-->
<style>
<!--table
{mso-displayed-decimal-separator:"\.";
mso-displayed-thousand-separator:"\,";}
@page
{
mso-header-data:"";
mso-footer-data:"";
margin:1in 0.75in 1in 0.75in;
mso-header-margin:0.5in;
mso-footer-margin:0.5in;
mso-page-orientation:Portrait;
}
tr
{mso-height-source:auto;
mso-ruby-visibility:none;}
col
{mso-width-source:auto;
mso-ruby-visibility:none;}
br
{mso-data-placement:same-cell;}
ruby
{ruby-align:left;}
.style0
{
mso-number-format:General;
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
border:none;
mso-protection:locked visible;
mso-style-name:Normal;
mso-style-id:0;}
.font0
{
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif"; }
td
{mso-style-parent:style0;
mso-number-format:General;
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
border:none;
mso-protection:locked visible;
mso-ignore:padding;}
.style0
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
mso-style-name:"Normal";
}
.style1
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style2
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style3
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style4
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style5
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style6
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style7
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style8
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style9
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style10
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style11
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style12
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style13
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style14
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.pg1-x15
{
mso-style-parent:style0;
mso-number-format:General;
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style16
{
mso-number-format:"0%";
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
mso-style-name:"Percent";
}
.style17
{
mso-number-format:"_\(\0022$\0022* \#\,\#\#0\.00_\)\;_\(\0022$\0022* \(\#\,\#\#0\.00\)\;_\(\0022$\0022* \0022-\0022??_\)\;_\(\@_\)";
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
mso-style-name:"Currency";
}
.style18
{
mso-number-format:"_\(\0022$\0022* \#\,\#\#0_\)\;_\(\0022$\0022* \(\#\,\#\#0\)\;_\(\0022$\0022* \0022-\0022_\)\;_\(\@_\)";
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
mso-style-name:"Currency [0]";
}
.style19
{
mso-number-format:"_\(* \#\,\#\#0\.00_\)\;_\(* \(\#\,\#\#0\.00\)\;_\(* \0022-\0022??_\)\;_\(\@_\)";
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
mso-style-name:"Comma";
}
.style20
{
mso-number-format:"_\(* \#\,\#\#0_\)\;_\(* \(\#\,\#\#0\)\;_\(* \0022-\0022_\)\;_\(\@_\)";
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
mso-style-name:"Comma [0]";
}
.pg1-x21
{
mso-style-parent:style0;
mso-number-format:General;
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:auto;
mso-pattern:auto;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
border-top:1px solid windowtext;
border-right:1px solid windowtext;
border-bottom:1px solid windowtext;
border-left:1px solid windowtext;
mso-diagonal-down:none;
mso-diagonal-up:none;
mso-protection:locked visible;
}
-->
</style>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>Sheet1</x:Name>
<x:WorksheetOptions>
<x:StandardWidth>2048</x:StandardWidth>
<x:Print>
<x:ValidPrinterInfo/>
<x:PaperSizeIndex>9</x:PaperSizeIndex>
<x:HorizontalResolution>300</x:HorizontalResolution>
<x:VerticalResolution>300</x:VerticalResolution>
</x:Print>
<x:Selected/>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:WindowHeight>9225</x:WindowHeight>
<x:WindowWidth>14940</x:WindowWidth>
<x:WindowTopX>240</x:WindowTopX>
<x:WindowTopY>120</x:WindowTopY>
<x:RefModeR1C1/>
<x:TabRatio>600</x:TabRatio>
<x:ActiveSheet>0</x:ActiveSheet>
</x:ExcelWorkbook>
</xml><![endif]-->
</head>
<body link=blue vlink=purple >
<table border=0 cellpadding=0 cellspacing=0 width=64 style='border-collapse:
collapse;table-layout:fixed;width:48pt'>
<col width=64 style='width:48pt'>
<tr height=17 style='mso-height-source:userset;height:12.75pt' id='r0'>
<td height=15 class=pg1-x21 width=64 style='height:11.25pt;width:48pt;'></td>
</tr>
<![if supportMisalignedColumns]>
<tr height=0 style='display:none'>
<td width=64 style='width:48pt'></td>
</tr>
<![endif]>
</table>
</body>
</html>
public void excel(){
ViewerConfig cfg = vwrConfig();
ViewerHtmlHandler vH = new ViewerHtmlHandler(cfg);
HtmlOptions o = new HtmlOptions();
o.getCellsOptions().setShowGridLines(true);
this._pages = new ArrayList<>();
try {
List<PageHtml> _p = vH.getPages("/tmp/dmu.xlsx", o);
for(PageHtml p: _p){
String content = p.getHtmlContent();
System.out.println(content);
if(content != null) {
this._pages.add(content);
}
}
System.out.println(this._pages);
} catch (Exception e) {
e.printStackTrace();
}
}
@kevinmarvin
Copy link
Author

The XLS file used with this is at http://activ8.us/test_xls.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment