How to validate a epub file with OPF more than 300KB? - epub

Am having an Epub with 110 html files and more than 7000 images.
I have reduced the file names by giving page breaks in CSS.
Also i have changed images name with minimum characters only.
<item id="f0001-01" href="f0001-01.jpg" media-type="image/jpeg"/></manifest>
by
<item id="i1" href="i1.jpg" media-type="image/jpeg"/></manifest>
Still my OPF size exceeds 300kb. How can i solve this problem?
Is there any Possibility of using two OPF's in a single ePub?

Related

Notepad++ deleting string in multiple files

I'm trying to removing a specific line from many files I'm working on with Notepad++.
For example i've a lines:
1 file:
<mana now="110" max="110" manaGain="6" manaTicks="500" type="3"/>
2 file:
<mana now="100" max="100" manaGain="11" manaTicks="500"/>
As you can see, there are different values. I'd like to remove this string from all files. Can i do it with Notepad++, especially if each file has a different value?
You can do it by using Notepad++ and RegEx. You maybe warned - please make a backup copy of all files first.
I assume your files all have the extension *.xml and reside in folder e.g. D:\_working:
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<mana now="110" max="110" manaGain="6" manaTicks="500" type="3"/>
</bookstore>
First open one of the files in your working directory by Notepad++
Ctrl+H
Go to the Find in Files tab
Find what:<mana now="[0-9]{1,}" max="[0-9]{1,}" manaGain="[0-9]{1,}" manaTicks="[0-9]{1,}".+
Replace with: NOTHING
Filters: *.xml
Directory: e.g. D:\_working
Search mode: Regular expression
Click on Replace in Files
Click on OK when you're really sure.
You may want to refine the RegEx for your needs. Short explanation:
0-9 a single character in the range between 0 (index 48) and 9 (index 57) (case sensitive)
{1,} Quantifier — Matches between one and unlimited times, as many times as possible
.+ matches any character (except for line terminators)
This is resulting in:
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
</bookstore>

Conversion error .doc to .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 :)

Issue with FDF on different platforms PDFTron

I am facing an issue wherein I am unable to show annotations on my PDF on IOS device that are made from some other platforms e.g web, Windows or android. What is actually happening is if I am editing an already created annotation like an underline by changing the notes associated with it from my iOS device, then it is not reflecting on other platforms.
On further Investigation, I found that the PDF format generated by PDFTRON on iOS is different from the format generated by PDFTRON on any other platform. For example, I draw an underline annotation on a document from the web. The initial FDF received is as follows:
<squiggly subject="Squiggly" page="0" rect="275.93,656.703203,336.2084,665.759453" flags="print" name="0eabf5b2-77ab-4c04-3379-438e7a8fc714" title="testuser" date="D:20161027122930+05'30'" color="#FF0000" opacity="1" creationdate="D:20161027121425+05'30'" coords="275.93,665.76,336.21,665.76,275.93,656.7,336.21,656.7"><contents-richtext><body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:spec="2.0.2" xfa:APIVersion="Acrobat:10.1.3"><p dir="ltr"><span dir="ltr" style="font-size:10.0pt;text-align:left;color:#000000;font-weight:normal;font-style:normal">under_line</span></p></body></contents-richtext><contents>under_line</contents><popup flags="print,nozoom,norotate" page="0" rect="0,692,150,792" open="no"/></squiggly>
I have entered the text under_line in the notes initially. Now when I edit this annotation from the web (Changing the text from under_line to under_lines) , the resulting FDF is as follows:
<squiggly subject="Squiggly" page="0" rect="275.93,656.703203,336.2084,665.759453" flags="print" name="0eabf5b2-77ab-4c04-3379-438e7a8fc714" title="testuser" date="D:20161027122930+05'30'" color="#FF0000" opacity="1" creationdate="D:20161027121425+05'30'" coords="275.93,665.76,336.21,665.76,275.93,656.7,336.21,656.7"><contents-richtext><body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:spec="2.0.2" xfa:APIVersion="Acrobat:10.1.3"><p dir="ltr"><span dir="ltr" style="font-size:10.0pt;text-align:left;color:#000000;font-weight:normal;font-style:normal">under_lines</span></p></body></contents-richtext><contents>under_lines</contents><popup flags="print,nozoom,norotate" page="0" rect="0,692,150,792" open="no"/></squiggly>
The same annotation when edited from an iOS device produces the following FDF:
<squiggly subject="Squiggly" page="0" rect="275.93,656.703203,336.2084,665.759453" flags="print" name="0eabf5b2-77ab-4c04-3379-438e7a8fc714" title="testuser" date="D:20161027122930+05'30'" color="#FF0000" opacity="1" creationdate="D:20161027121425+05'30'" coords="275.93,665.76,336.21,665.76,275.93,656.7,336.21,656.7"><contents-richtext><body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:spec="2.0.2" xfa:APIVersion="Acrobat:10.1.3"><p dir="ltr"><span dir="ltr" style="font-size:10.0pt;text-align:left;color:#000000;font-weight:normal;font-style:normal">under_line</span></p></body></contents-richtext><contents>under_lines</contents><popup flags="print,nozoom,norotate" page="0" rect="0,692,150,792" open="no"/></squiggly>
Now you can see the difference. When I edit the text on the web, the text is changed at both points wherever it appears while when it is changed from the iOS device , the text is updated at only one place.
I believe this is causing a problem for me. How can I resolve this?
Annotation can actually have two Contents. The regular one, and a Rich Contents (essentially a minimal subset of HTML). The two are not guaranteed to be the same, which is the case here. One field got updated, the other didn't, as this actually depends on the specific PDF software used.
There is no difference between our different SDK's in this regards, so either you used two different files, or two different PDF readers. It sounds like on iOS used a 3rd party program.

Using XSL to print on paper other than A4

I need to use XSL to generate a letter and print it to a page that is not A4 size.
I have tried setting page-height & page-width, but this just sets up the working regions and does not include any paper size information. Thus when I view it via Adobe Reader the page dimensions are still A4 size.
In my xsl I currently have the following
<xsl:template name="LAYOUT-SETUP">
<fo:layout-master-set>
<fo:simple-page-master master-name="first-page" page-height="55mm" page-width ="85mm" margin-top="5mm" margin-bottom="4mm" margin-left="3mm" margin-right="3mm">
<fo:region-body />
<fo:region-before extent="0mm" region-name="xsl-region-before-first"/>
<fo:region-after extent="0mm"/>
</fo:simple-page-master>
It seems you struck anywhere to identify correct page... Have a look on some examples how to define page setup of FO in http://www.learn-xsl-fo-tutorial.com/Page-Layout.cfm#h1.1

PartCover browser not opening code files

We're generating PartCover reports via the command line tool along with our CruiseControl.Net unit tests. This generates an xml file that displays the results nicely on the cruisecontrol dashboard. The xslt transforms that are included only show you the percentage of coverage in an individual class. We want to know exactly what lines are not being covered. The problem ist when we open the report in the PartCover browser and double click a method it doesn't show us our cs files. I know the PartCover browser is capable of showing you the files because of the following.
Here's a screenshot of PartCover browser with the lines of code showing: http://kjkpub.s3.amazonaws.com/blog/img/partcover-browse.png.
The information looks like it should be available to the browser because the report contains this:
<Method name="get_DeviceType" sig="Cathexis.IDBlue.DeviceType ()" bodysize="19" flags="0" iflags="0">
<pt visit="2" pos="0" len="1" fid="82" sl="35" sc="13" el="35" ec="14" />
<pt visit="2" pos="1" len="4" fid="82" sl="36" sc="17" el="36" ec="39" />
<pt visit="2" pos="5" len="2" fid="82" sl="37" sc="13" el="37" ec="14" />
</Method>
and this:
<File id="66" url="D:\sandbox\idblue\idblue\trunk\software\code\driver\dotnet\Common\AsyncEventQueue.cs" />
All I want to be able to do is view what lines of code are not being covered in my test cases without having to figure out what the xml above is trying to tell me.
Thanks to anyone in advance who replies.
I figured out why the cs files were not displaying. The paths were incorrect in the xml file because our test project was being built on a different machine than the one partcover was on. (partcover must generate the .cs file paths from pdb files maybe?) Once I search and replaced the file switching the base directory of our subversion location to the one on the other machine all was well.

Resources