Loss of white space when saving HTML table as Excel - oledb

I've successfully got my web application to export Excel files by creating HTML tables and returning that with an Excel data type.
If I open the file up in Excel, and save it, the markup changes from:
<td>One Two</td>
to...
<td>One
Two</td>
It seems like Excel is wrapping the lines with \r\n, but not putting a space in there. In Excel, it renders the cell with white space, but when I read it with OLEDB, there is no white space.
Can this be resolved by reading it differently, or exporting it differently, or perhaps adding some MS specific CSS?

Related

AutoSizeColumns not working properly in ASP .NET Core with DoNetCore.NPOI

I'm using DoNetCore.NPOI to export a Grid (mvc6-grid) into an Excel file. During the exporting process, I have set the property:
Sheet.AutoSizeColumn(columnIndex)
for each column in my grid, but the resulting file shows that text in each column is being cutted.
Here you have an example about what I am saying:
AutoSizeColumn Cutted Text Example:
I have trying to change the font family, but it has not done anything.
I think that maybe could be important to inform you that in one column there could be specials characters like the "ñ" character.
Thank You!

SSIS: Can't handle line-feeds in CSV (Column delimiter not found)

I have some CSV files that appear OK in Notepad and Excel however seem to have extra line-feeds in them when I view them in VS2010 or Notepad++. When I attempt to process them in SSIS, the files fail with errors like this:
Error: 0xC0202055 at Merge Files, Interface [225]: The column delimiter for column "Column 48" was not found.
Here's a truncated example (there's about 50 columns, and the line-wrap appears to wrap randomly at the same position):
The questions are: how does Notepad and Excel open these files OK (and seemingly ignore the line-feeds)? Is there a way to get SSIS to process these files? Could it be an SSIS setting on code-page etc?
For me opening the file in Excel, saving as an excel file (xlsx but I am sure the old xls format would work fine too), then using the Excel Source in SSIS enabled me to load a file into a SQL table with this kind of problem.
Obviously this would not work if you need to load this kind of file regularly or if there was many of these files. In that case the first answer would be better.
The easiest solution for us was to stage the input into a SQL table, and then in a subsequent data-flow, query it back-out without line-feeds in the CSV output, e.g.
SELECT COLUMN1
,REPLACE(REPLACE([COLUMN2],CHAR(10),''),CHAR(13),'') AS [COLUMN2]
FROM TABLE

iOS search and replace PDF string

Is it possible to search and replace a known string from a PDF with Objective-C/Quartz 2D?
I've some nice formatted PDF with tabular data, created with Latex (and generated with pdflatex). Every pdf will have a placeholder string, something like XXXXXX that I would like to change programmatically.
This strings will be replaced only by other numbers.
I'm aware that the PDF could be an editable form, but i don't want it because i prefer to leave all the fonts and formatting as they're typeset by Latex.
It is not possible to search and replace text in PDF files using Quartz 2D. Quartz 2D offers a read only low level interface for reading PDF files. While searching can be implemented on top of it, although with much effort, modifying the files and replacing text is not possible.

Including full LaTeX documents within others

I'm currently finishing off my dissertation, and would like to be able to include some documents within my LaTeX document.
The files I'd like to include are weekly reports done in LaTeX to my supervisor. Obviously all documents are page numbered seperately.
I would like them to be included in the final document.
I could concatenate all the final PDFs using GhostScript or some other tool, but I would like to have consistent numbering throughout the document.
I have tried including the LaTeX from each document in the main document, but the preamble etc causes problems and the small title I have in each report takes a whole page...
In summary, I'm looking for a way of including a number of 1 or 2 page self-complete LaTeX files in a large report, keeping their original layouts, but changing the page numbering.
For a possible solution of \input-ing the original LaTeX files while skipping their preamble, the newclude package might help.
Otherwise, you can use pdfpages for inserting pre-existing PDFs into your dissertation. I seem to recall that it has a feature of "suppressing" the original page numbers by covering them up with white boxes.
The suggestion from #Will Robertson works great. I'd just like to add an example for all lazy people:
\usepackage{pdfpages}
...
% Insert _all_ pages from some_pdf.pdf:
\includepdf[pages=-]{some_pdf} % the .pdf extension may be omitted
From the documentation of the package:
To include a specific range of pages, you could do pages={4-9}. If start is omitted, it defaults to the first page, if end is omitted, it defaults to the last page.
To include it in landscape mode, do landscape=true
Maintaining the original formatting per document will be difficult if they're using different formats. For example, concatenating different document classes will be near impossible.
I would suggest you go with the GhostScript solution with a slight twist. Latex allows you to set the starting page number using \setcounter{page}{13} for example. If you can find an application that can count the pages of a PDF document (pdfinfo in the pdfjam Ubuntu package is one example), then you can do the following:
Compile the next document to PDF
Concatenate the latest PDF with the current full PDF
Find the page count of the full PDF
Use sed to pluck in a \setcounter{page}{N} command into the next latex file
Go back to the beginning
If you need to do any other processing, again use sed. You should (assuming you fix the infinite loop in the above algorithm ;-) ) end up with a final PDF document with all original PDFs concatenated and continuous line numbers.
Have a look a the combine package, which seems to be exactly what you're searching for.
Since it merges documents at the source level, I guess the page numbers will be correct.

Best Way to Automate Adding Text to an Image and formatting for Printing?

Here's what I have:
Quarter Sheet Flyer (4 per page) as a PSD or JPG
Text file with one entry of text per line.
What I want to do:
Print out 100 flyers (on 25 pieces of paper)
Somehow automate the process of adding the text to the image, either via some scripting language or a Photoshop automated task. Then format the pages to print, either to generate a 25 page PDF file or generate four at a time and send them to the printer page by page.
Anyone have any experience with something like this or have any recommendations on how I should go about doing this?
Thanks for your help!
You can use Microsoft Word automation to generate a word file with the correct text and image, and then just print it.
This would be one of the simpler solutions, you can implement the entire thing as a word macro (VBA).
A more complex solution would be to use VB6 or .net to print the text and the image into the form and then print the form.
You can write a script that will generate an html page with the image and the text, and then print out the html using a browser.

Resources