Conversion error .doc to .epub - epub

I uploaded .doc to smashworld, and got the warning while validating the .epub
ERROR toc.ncx 15 43 Error while parsing file 'different playOrder values for navPoint/navTarget/pageTarget that refer to same target'.
ERROR toc.ncx 15 265 Error while parsing file 'different playOrder values for navPoint/navTarget/pageTarget that refer to same target'.
And here is part of the codes.
Shan Hai Legend Vol.1, [Part 1of2]Midpoint
I have no idea..how it can be fixed. Can anybody help me out?

As you probably know a ePub file is like an archive of files. It contains the textual files (usually .xhtml, .html), the stylesheet files (usually .css), the images used in the book and the configuration files. Your toc.ncx (The file that contains the index order and structure) has 2 or more items with the same playOrder or is corrupted.
The playOrder property specifies the actual position of the Chapter in the index.
If you use playOrder="1" with chapter 1 and playOrder="1" with chapter 2, the ePub reader doesn't know what to put first.
I suggest you to download Calibre, import your ePub, check for errors, and open the toc.ncx to see its structure.
You will get something like that:
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1" xml:lang="it">
<head>
<meta content="...." name="...."/>
</head>
<docTitle>
<text>Book Title</text>
</docTitle>
<navMap>
<navPoint id="num_1" playOrder="1">
<navLabel>
<text>Chapter 1: some title</text>
</navLabel>
<content src="chapter-01.html"/>
</navPoint>
<navPoint id="num_2" playOrder="2">
<navLabel>
<text>Chapter 2: some title</text>
</navLabel>
<content src="chapter-02.html"/>
</navPoint>
</navMap>
</ncx>
Just check if every playOrder is incremented by 1 for each navpoint.
If you find the error, manually insert the correct values, save and export the eBook.
If you don't know how to fix it, post here the toc file and we will try to understand the mistake :)

Related

Getting compilation error with latex file in overleaf

This is my first time with overleaf. I have a latex template, and when I try to compile it shows the following error:
Emergency stop.
<*> header.tex
*** (job aborted, no legal \end found)
Here is how much of TeX's memory you used:
28699 strings out of 480906
561966 string characters out of 5908280
1147859 words of memory out of 5000000
43764 multiletter control sequences out of 15000+600000
539149 words of font info for 32 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
73i,1n,97p,10101b,276s stack positions out of 5000i,500n,10000p,200000b,80000s! ==> Fatal error
occurred, no output PDF file produced!
I am not sure what to do.
Can someone please suggest how I can solve this problem?
In case you need some more information, then please let me know. I will add here.
Edit: header file that is throwing error: http://www.itextpad.com/pH0GJ5Bfmg
The document you have provided is simply a preamble file. It does not contain the document body \begin{document} ... \end{document} hence the Emergency stop fatal error.
What you should do is save this file under some name, say mypreamble.tex. Create a new .tex file and have both files under the same file directory. Finally, in the new file
\include{mypreamble.tex}
\begin{document}
\thesistitle
\section{Section 1}
/*
* Write stuff and commands here
*/
\end{document}
The file you have provided does not seem to be a classic template which you copy-paste, change some fields and have your product. It seems to look more like a file containing some functions and predefinitions which helps you structure your file in a certain way. I would suggest looking for another template that includes a document main body, which you would be able to implement and use immediately.

SEC company filings: Is the <SEC-HEADER> tag valid SGML? If so, how to parse it?

I tried to parse SEC company filings from sec.gov. Starting from fb 10-Q index.htm let's look at a complete text submission filing like complete submission text filing. It has a structure like:
<SEC-DOCUMENT>
<SEC-HEADER>
<ACCEPTANCE-DATETIME>"some content" This tag is not closed.
"some lines resembling yaml markup"
These are indented lines with a
"key": "value" structure.
</SEC-HEADER>
<DOCUMENT>
.
.
some content
.
.
</DOCUMENT>
"several DOCUMENT tags" ...
</SEC-DOCUMENT>
I tried to figure out the structure of the <SEC-HEADER> tag and found some information under Public Dissemination
Service (PDS) Technical
Specification (pdf) and concluded that the content of the header should be SGML.
Nevertheless, I am clueless about the formatting, since there are no angle brackets, and the keys - value paires are separated by colons like key: value instead of <key>value</key>. In the pdf link I could not find anything about colons.
Question: Is the <SEC-HEADER> tag valid SGML? If it is, how to parse it?
I'd be glad at any help.
The short answer is no. The <SEC-HEADER> tag in the raw filing is not a valid SGML.
However, it is my understanding that this section in the raw filing is parsed automatically from the header file <accession_num>.hdr.sgml, which does follow SGML. This header file can be found in the same directory as the raw filing (i.e., the <accession_num>.txt file).
I use a REGEX of the form: ^<(.+?)>(.+?)$ (with re.MULTILINE option) to capture each (tag, value) tuple and get the results directly in a dict().
I believe the only tag in that file that has a closing tag is the </FILER> tag, where there could be multiple filers in each filing. You can first extract those using a REGEX of the form: <FILER>(.+?)</FILER> and then employ the same REGEX as above to get the inner tags for each filer.
Note that other than 'FILER', there could be other tags, representing different relations of the entities to the filing. Those are 'ISSUER', 'SUBJECT COMPANY', 'FILED BY', 'FILED FOR', 'SERIAL COMPANY', 'REPORTING OWNER'.

How to avoid Excel "bad format error" when saving spreadsheet

Using PHPSpreadsheet saving XLSX format works OK running the default code
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($spreadsheet);
$writer->save("filename.xlsx");
But if I want to have the user to select the target directory using
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="filename.xlsx"');
header('Cache-Control: max-age=0');
$writer = IOFactory::createWriter($spreadSheet, 'Xlsx');
$writer->save('php://output');
The file saves OK but Excel 2016 does not want to open it. Excel returns the following error
Excel Error
I looked through all documentation and posts but cannot find the solution.
Thanks !
Edit: Just in case, this solution does not work for me.
Edit 2: The sample provided Simple Download Xlsx works perfectly, but when doing a copy/paste for my spreadsheet, Chrome gives me a
Resource interpreted as Document but transferred with MIME type application/octet-stream
Edit 3: Used
ob_end_flush(); to clean any left over header in my code.
The file now saves OK, but needs repair when opening in Excel. Why ?
Thanks
Solution:
Bug from PhpSpreadsheet.
When using
header("Content-Type: application/vnd.ms-excel");
i.e. compatibility mode for Excel, the file opens OK.

PHPEXCEL weird characters on form inputs

I need some help with PHPEXCEL library, everything works great, I'm successfully extracting my SQL query to excel5 file, I need to give this file to transport company in order to auto collect informations about packages, unfotunately the generated excel file has some ascii characters between each letter of the cell text, and when the excel file is imported you need to manually delete these charaters.
If I open the excel file, everything is fine I see: COMPANY NAME, If I open the excel file with notepad++, I see the cell values this way: C(NUL)O(NUL)M(NUL)P(NUL)A(NUL)N(NUL)Y N(NUL)A(NUL)M(NUL)E
If I open again the file with excel and save, then reopen with notepad++ I see COMPANY NAME.
So I do not understan why every time I create an excel file using PHPEXCEL my every letter of all words are filled with (nul) every letter.
So how do I prevent the generated excel file to include (nul) between every word????
Also if you open the original excel file generated from PHPExcel samples are also filled with (nul) and if you open and save it, the (nul) is gone.
Any help would be appreciated, thanks.
what is the (nul) ??? 0x00??? char(0)???
ok, here is the example:
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
date_default_timezone_set('Europe/London');
if (PHP_SAPI == 'cli')
die('Disponibile solo su browser');
require_once dirname(__FILE__) . '/Classes/PHPExcel.php';
$objPHPExcel = new PHPExcel();
$objPHPExcel->getProperties()->setCreator("Solidus")
->setLastModifiedBy("Solidus")
->setTitle("Import web")
->setSubject("Import File")
->setDescription("n.a")
->setKeywords("n.a")
->setCategory("n.a");
$objPHPExcel->setActiveSheetIndex(0)
->setCellValueExplicit("A1", "COMPANY")
->setCellValue('A2', 'SAMSUNG');
$objPHPExcel->getActiveSheet()->setTitle('DDT');
$objPHPExcel->setActiveSheetIndex(0);
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="TEST.xls"');
header('Cache-Control: max-age=0');
header('Cache-Control: max-age=1');
header('Cache-Control: private',false);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
ob_end_clean();
$objWriter->save('php://output');
As you can see from this little example, this scripts creates a file excel5 with 2 cells, A1 = COMPANY, A2 = SAMSUNG
when I send this file to the transport company, they import the file into their system, but as you can see from the picture, there is an weird character between each letter.
so I noticed every time I open the generated Excel5 with notepad++ file I get:
S(nul)A(nul)M(nul)S(nul)U(nul)N(nul)G
If I save the save with excel and then open it again with notepad++ I get:
SAMSUNG
and this file is ok for the transport company
so my question is, how should I avoid the file generated to contain thi '(nul) charachter between each letter????
some help?
weird characters
SAMSUNG
I found the soluion by myself, I explain just in case anyone has also this problem:
there is not way to change the way the excelfile is encoded by PHPEXCEL
so I figured out the problem was reading the file, I did some simulations and reproduce the problem, every time a read the file and put the result into inputs a get weird characters:
C�O�M�P�A�N�Y�
If I set the output enconding enconding as follows:
$excel->setOutputEncoding('UTF-8');
the file loads fine, so the problem was not creating the excel file, but reading the excel file.
If I print the variable with ECHO I get: "COMPANY",
if I put the variable on input as value I get: "C�O�M�P�A�N�Y�"
setting the output solves the problem, but I would like to know why the difference when I put the variable on input as value, thanks

LaTex compilation doesn't generate output

Can't generate the output of my LaTex document (using TeXnicCenter). At the end of the log he says:
Latex-Result: 0 Error(s), 0
Warning(s), 0 Bad Box(es), 0 Page(s)
and correspondingly the viewer says it couldn't find the file.
I have defined the path of the pdf viewer but it didn't help. The path of the source document doesn't contain spaces. Does anyone know how to fix this problem?
Thanks in advance!
Thank you very much, Steve, but I've just found the problem: I had to change the "Install packages on-the-fly"-setting to "yes" instead of "ask me first".
In my case I uploaded the project zip then this error was shown ,
The fix was to first create blank project then upload the zip file contents.

Resources