MigraDoc - Get Pages Number - pdfsharp

How I can get the number of pages before rendering? I need to write the number as words in my document.

For page numbers as numbers:
You don't have to get the number, you can add placeholders (called Fields) to your document and MigraDoc will insert the page numbers automatically while rendering the document.
See AddPageField() in this sample:
http://pdfsharp.net/wiki/HelloMigraDoc-sample.ashx
Other field functions are AddNumPagesField(), AddSectionField(), AddSectionPagesField(), AddDateField(), and AddPageRefField(string name)
For page numbers as words:
There is no built-in solution to get page numbers as words.
Where do you need the page numbers? It is possible to have MigraDoc create a document without page numbers and then use PDFsharp to add the page numbers as words in either the header or the footer.
If you need page numbers as references within the text then I don't have an easy answer.
See also:
http://forum.pdfsharp.net/viewtopic.php?p=8476#p8476

Related

How to determine if Mammo image is MLO or CC?

I'm confused as to which tags need to be examined to determined if a Mammo image is MLO or CC.
On sample sets I have I see the relevant information in View Position(0018,5101) i.e. a value of "MLO".
However looking at the standard it refers to Partial View Code Sequence (0028,1352) which is a sequence and there are more than just MLO/CC values.
The correct tag to check is the View Code Sequence, not the Partial View Code Sequence (that is only for partial views, as the name suggests, which seems not to be your case). In the sequence, you have to check the Code Value for the respective code. For example, MLO images get the code R-10226, as can be seen in the table.
Only if that sequence is not present or empty, you have to check for fallback tags like View Position. View Position is defined for CR and DX images, not for MG images (and actually does not have MLO or CC as defined terms), but as always, derivations from the DICOM standard by some modalities have to be taken into account, and you have to check if the images you process conform to the standard.

How to generate mutiple pages with BIRT Report Designer

I would like to generate multiple page of a report. The number of pages would be defined in a variable from a Data Set.
example: if the variable is set to 5, the report would be generated in 5 copies (1/5, 2/5.. 5/5).
I'm using BIRT Report Designer 4.4.0.
The rest of the report is filled with other data that would stay the same in the n pages.
I managed to show the page number and the total number of pages (the variable) but didn't manage to generate that amount of pages.
I have no clue how to proceed, so until now, I only manage to generate 1 page.
You can use either a scripted data set or some SQL statement (for e.g. on Oracle something like this)
select rownum from user_objects where rownum <= :pi_num_copies
to create a "for-loop" data set.
I would try the following.
Insert (into the report) a Table binded to your Data Set with a
single column - your "NumberOfCopies" field.
Add Group for the NumberOfCopies.
Put your repeating n-times data to the Table Detail (you can replace the original field with it). Add fixed (for
every page) info to Group header and footer.
Set After property to Always in Page Break paramener
section for Group Footer (not for table's one!)
I guess it will work. If not - play around with Page Break options in Table Footer and Detail...

Is it possible to filter the list of fields when outputting a Full Dataset?

I have a DataTable that I'm passing to a FlexCel report. It contains a variable number of columns, so I'm using the Full Dataset feature (e.g. <#table_name.*>).
However, only a subset of the fields are dynamically generated (I have a variable number of attachments). The column name for each attachment field starts with a common word (e.g. "Attachment0", "Attachment1", etc).
What I would like to do is output the known finite set of fields and then the variable number of attachments. It would be nice if I could write something like <#table_name.Attachment*> (and <#table_name.Attachment**>). Is there any way in FlexCel Reports I can achieve the same result?
A side benefit to such a solution means that I could keep the formatting for the known/finite set of fields.
Update
I added place holder columns to the document, each with a <#delete column> tag, so that the un-wanted columns/data are removed.
Although this works, it's not ideal. For example, if I want to see how the columns fit in the page width (in print preview), then I need to hide the columns. Then I have to remember to un-hide them again, so other developers can see/understand my handy work.
It would be much more straight forward if I could filter the fields before they're output to the document.
I realised there's an alternate way around this problem. I broke up the data into two sets of data - <#table_name.*> and <#table_name_attachments.*>.
The fixed set of fields are in the first table and the variable set of fields is in the second table (all the "Attachment*" fields). When the report is run, I place them next to each other (in the same order) in the same worksheet. This means I have two table ranges - "_table_name_" and "_table_name_attachments_" on the one sheet.
Now I'm able to run my print preview without hiding/re-showing the columns-to-be-deleted. I've also eliminated human error - it was all to easy to accidentally set the wrong number of padded/delete columns.

CSS/JS - Force a line break at a comma in comma separated list

I have a table cell in which there is list of aircraft registration numbers in the format 'X-XXXX'. The width of the table cell means that the list gets word-wrapped on the hyphen, like so:
G-ABCD,G-
EFGH,G-
IJKL
What I'd like to happen is that the line-break is forced on the comma:
G-ABCD,
G-EFGH,
G-IJKL
However, I cannot insert any special characters. This is because when the form is submitted, the data in the table is submitted as JSON format which is then json_decoded in PHP. Any special characters in the comma separated string then stops the json_decode function from turning it into an array.
So I really need a solution that does not alter the list in anyway? Sounds impossible...
To force a line break, use the <br> tag. If you cannot have it in the HTML markup, add it with JavaScript.
This answers the question asked. The actual problem is probably different. You need to post more code and ask differently to have it solved. What is the context, what are the constraints, and what do you actually want to do? (From the discussion in the comments, it seems that you rather want to prevent line breaks after hyphens than force any breaks.)

XSLT - Table to continue in 3 columns on the same page

Hopefully someone has done this - I need a 3 column page (side-by-side) with a two column table (with the headers) to fill the three columns. The table is fairly long and I need it to wrap/continue from the first column on the page to the second column and on to the third and then continue to the next page in the same fashion. Right now I can only get the table to show in one column on the page and it continues on the next page. The final output is a printed PDF page.
Using span="all" is the way to cause some in flow content to span all the columns of a multi-column document. For brevity in answering, I am posting a picture of the XSL FO for something like this.

Resources