With xlwt, How do I set my page/paper size to be "letter" or 8.5X11 instead of A4? - page-size

Title basically explains it, but I can't for the life of me get away from the A4 page size and I am having to resize each file individually. I have a LOT of files. Nearly 2000 now, and its kinda getting old.
Thank you to anyone who helps in advance!

sheet.paper_size_code = 1
is what you want.
example:
book = Workbook()
sheet = book.add_sheet('2013')
sheet.paper_size_code = 1
sales_units(OUTPUT, header_list, DATE, book, sheet)
book.save('Projections.xls')

Related

how to write a text and calculation in a same time like Calcnote app in Flutter

I try lots of things but I failed kindly help me with how to do this and please someone shares a complete. I also share a screenshot of the original app I making same like this app.
App description:
1:When typing or calculating on the app if the user needs the next line and show a list num
2: The most important thing is when we calculate any num can we write something in the same type ( you think it's a notepad + calculator)?
3: Also when we write and type 5 + 5 we don't need to press = equal to. they abstract and subtract automatically.
thank you so much for your support.

iTextSharp large table: adding in chunks leaves visible gaps in the table

I have a large table I'm adding to a document. In order to avoid running out of memory, I'm doing this:
if (rowCounter % 100 == 0)
{
document.Add(affidavitsTable);
}
That improved performance, but now, after ever 100 rows, there's a gap in the middle of the table:
I've placed a screenshot here - sorry can't post images yet... :-/
I'm don't really understand what the comments mean here but I'm wondering if it's related.
Any help would be appreciated!
Thanks,
Eliezer
I found the answer. This line was hiding in my code:
affidavitsTable.SpacingBefore = 8;
:-\

Error 24 too many files open

I am doing a game. it requires lots of images. When using the app in normal case it will be quite running fine. But when it rash then i get the error 24 - too many files open.
I searched it but , i didn't get the appropriate answer.
please reply.
Code from comment formatted:
-(void)flowerImagesAnimate {
self.flowerImage.animationImages = self.flowerArray;
self.flowerArray = nil;
self.flowerImage.animationDuration = 1.0;
self.flowerImage.animationRepeatCount = 3;
[self.flowerImage startAnimating];
}
– Munnu 1 hour ago
Don't open so many files.
If you have more open than you need, close them. If you need that many open, collect them in to 1 larger image and use portions.

OpenXML: Issue adding images to documents

Up until now, this block of code has been using to build documents with text for several months with no snags. I am now trying to dynamically add images. I've spent about two days staring at code and researching and am at an end. I suspect the issue is that relationships are not being created (more details below.) Maybe not?
//set stuff up...
WordprocessingDocument doc = WordprocessingDocument.Open(fsPat, true, new OpenSettings(){
AutoSave = true,
MarkupCompatibilityProcessSettings = new MarkupCompatibilityProcessSettings(MarkupCompatibilityProcessMode.ProcessAllParts,
DocumentFormat.OpenXml.FileFormatVersions.Office2007),
MaxCharactersInPart = long.MaxValue
});
MainDocumentPart mainPart = doc.MainDocumentPart;
.
.Other stuff goes here
.
//now the fun...
Run r2 = new Run();
// Add an ImagePart.
ImagePart ip = mainPart.AddImagePart(ImagePartType.Png);
string imageRelationshipID = mainPart.CreateRelationshipToPart(ip); //
using (Stream imgStream = ip.GetStream())
{
System.Drawing.Bitmap b = new System.Drawing.Bitmap("myfile.png");
b.Save(imgStream, System.Drawing.Imaging.ImageFormat.Png);
}
Drawing drawing = BuildImage(imageRelationshipID, "name"+imageRelationshipID.ToString(), 17, 17);
r2.Append(drawing);
p.Append(r2);
The image part is essentially copied from http://blog.stuartwhiteford.com/?p=33) and is running in a loop presently. I also copied his BuildImage() function and use it as-is.
When I open the resulting docx, I see red Xs where the images are saying "This image cannot currently be displayed."
When I open the zip, the images will appear in root/media, but not root/word/media as I'd expect. I also cannot find the images referenced in any of the relationship files. Ideally they'd be in root/word/_rels/document.xml.rels. You'll notice I changed how imageRelationshipID is set hoping to fix this. It didn't.
Please help. Thank you.
So... It seems like OpenXML just hates me. I copied AddImagePart code from like 3-4 places among trying other things--none of which lasted long--and just could not get relationships to form. The implication I see is that they happen automatically with the AddImagePart function.
I ended up doing a complete workaround where I add all the pictures I might want to put and remove the Drawing nodes' parents of the ones I didn't want (Run nodes, generally.) Since these are very small pictures, it's feasible and in ways more elegant than trying to add them as necessary since I don't have to keep track of where images are stored on disk.

Count-Up Timer Required, iPhone Programming

I am new to iPhone programming so am hoping someone can help me out here. I have searched the web, but can only find information on count down timers.
What I am looking to do is start a count up timer when a button is pressed and then stop it when a certain value drops by, say 5, and finally display that time. I can display values on screen once I have them, but getting the time in the first place is proving difficult for me.
I apologize if this is a simple question, but I look forward to reading your responses.
Thanks in advance,
stu
NSDate will provide the current date. You can use - (NSTimeInterval)timeIntervalSinceNow
to get the time since the first call and now.
There's no difference between an up-counter and down-counter. Just change the order of your subtraction.
UpcounterElapsedTime = UpcounterCurrentTime - UpcounterStartTime;
DowncounterElapsedTime = DownCounterStartTime - DownCounterCurrentTime;