PDFlib - trimming pages - pdflib

I am trying to figure out whether it's possible to trim a PDFlib page AFTER its dimensions have been set.
For example, I have a non-standard page that is 500x10000pt:
$p->begin_page_ext(500, 10000, '');
...
$p->end_page_ext('');
After I'm done adding elements to it, I will know how tall that page should be.
How can I trim that page to the height of 2000pt?

How can I trim that page to the height of 2000pt?
by simple using:
$p->end_page_ext('width=500 height=2000');
It's just important that this will reduce the page dimension from the origin (lower left). Otherwiese you might use the cropBox Option to crop the page to some special area. For example:
$p->end_page_ext('cropbox={100 100 600 2100}');
Please see PDFlib 9.2 API Reference, chapter 3.3 for details for all option of end_page_ext().

Related

RDLC Report Hidden rectangles Creates Empty Pages

I found a similar question on the link: rdlc-report-hidden-charts-creates-empty-pages, but it didn't helped.
I have two sections that needed to be hidden when data is not present. however after adding a new section in the accident info section I am getting the error. My page size is 8.27in, 11.69in. Interactive size is 8in, 11in.
On that section previous height was 7.8 inch now its increased to 8 inch. After subtracting header and footer 8.4 inch space is available for the page. if margin is considered only 0.1 inch margin is there for all sides. ConsumeContainerWhitespace is also true.
For some data where these two rectangles are not visible an empty page is generated. This should not be the case as after hiding them from expression widget moves up automatically. On some sections property "PageBreak" is set to BreakLocation=Start. It is because some sections needs to be saved in a new page.
page before break
Page after break
here is the sample code for RDLC
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>
<rd:ReportUnitType>Inch</rd:ReportUnitType>
<rd:ReportID>38832df4-093b-4332-b811-4e31095617ec</rd:ReportID>
</Report>
Sorry I am unable to load my full RDLC as the body limit is exceeded.
I am using reporting version 8.
I think it may work if you move the content of the textbox inside a Tablix.
Then use Row Visibility to hide / show that row instead of the textbox itself.
If your design is more complex, like multiple combination of hide / show textbox.
You will need to use the Show or hide based on an expression function to check all textboxes' visibilities.
Firstly I would like to thank #HardcoreGamer for support. In this case I tried with only Tablix widget with row visibility and widget visibility based on expression. None of the approach worked. I had got one concept wrong that on hiding the widget or Tablix report takes no space. The report takes space which is between the widgets.
I also tried with two different schema as well i.e. RDL 2008 and 2016 but same thing happened on both.
I posted similar question on Microsoft form as well : RDLC Report Hidden rectangles Creates Empty Pages
What finally worked is that I reduced the rectangle of previous page by a margin of 1 inch excluding padding, page margin and footer for A4 size page. The space between the widgets was 0.5 inch. for hiding two widgets additional space of 1 inch is required, so that a new page doesn't gets generated.
Final image with changes
I still have to find a way out if data increases then the new page dosent get generated.

Increased fontsize of ttk::treeview leads to overlapping rows

If I change the fontsize of a treeview (that is already created) from e.g. 8 to 16 the rows overlap each other. I made some attempts to change the padding but I had no success. Other widgets change automatically their size in the right way if I change the font size, but not the ttk::treeview widget.
You can use the option -rowheight, however :
... The -rowheight value is not corrected by the tk scaling value or by the configured font size and must always be set ...
More about styling this widget: ttk::treeview manual page
Saludos!,

SSRS - Blank Pages (again...) even with respected settings

I know that the question was submitted a lot of times, but this is driving me mad.
I'm trying to make a landscape A4 report, printer friendly. As I could see in lots of threads before I tried to respect the fact that the body size must be inferior or equal to the physical page, including margins, and columns in the count.
Here are my document properties
Report:
Body:
I inserted a first rectangle with some contents, at that point, no extra blank page, here is the rectangle location :
Right after I inserted a second rectangle with same dimensions as previous one:
Both first pages are rendered correctly with the rectangle at its expected location, but I get a 3rd extra blank page...
ConsumeContainerWhiteSpace property is set to true, and this did not help...
Do you have any trick to get definitely rid of these blank pages ?
Thanks a lot !
EDIT : Just added the report designer view, as requested
Don't know how I didn't notice it before, but your body height is bigger than your page height defined in the report properties. If your report is supposed to generate two pages, that second page will have to add an extra 3 centimeters and cause that third page.
I finally managed to handle this the following way : I put my first rectangle 0,5cm under the header (with a forced pagebreak after) and if I use the same size of rectangle for everypage, ensuring that there's a 0,5 cm space between each rectangle, I can manage to display content on multiple pages, with rectangle bordel always located at the same position. Guess I should keep this method for all future reports :) Thanks a lot for your advices !

How to position an element on top of another element without using position and margin?

This is my code:
<table>...Some content...</table>
<table>...Another content...</table>
I want to put the second table on top of the first table. This is to be used as an email template (in some clients position and margin are not available).
Those are the only two options available (outside of transform, which definitely won't work if position isn't available) that will allow one element to invade another element's space. If you can't use position or margin, then you're out of luck, and you need to re-evaluate what you are trying to achieve and why. Any chance you could do this with images?
There are always ways...not always elegant, but when you have limited options, 'works' is often all you really need. IMO, creativity is as much about solving a problem with limited options as it is thinking 'outside the box'.
Most email clients allow you to set 'height', so simply wrap the first table (the background) in a div and give that div height:0px;. the table will overflow the div, but the next element won't respect it's space because it has 0 height, and will effectively be layered in front.
http://jsfiddle.net/L0d3tnzu/
If you want the size of the tables to match exactly, you'll probably have to explicitly set heights and widths, but the fiddle above illustrates the basic concept. Hope this helps!
EDIT:
Based on the additional info in the comment (the second table should only partly overlap the first table) here is an updated fiddle: https://jsfiddle.net/acq3ob6y/1/
EDIT #2:
Dang. Outlook switching to the Word/Office rendering engine for HTML/CSS might be the only way possible to get WORSE than the IE version. Sigh. (Thanks to #Gortonington for the comment/clarification, though!)
Ok, then, the idea of a background image is only a problem for retina displays (if you want them to be all crisp and beautiful and retina-ie), and retina devices are going to be handling CSS in a more modern way (hopefully!), so how about this as a solution: Media Query targeting device resolution loads CSS with the double-size img and uses css background-size to constrain it: http://jsfiddle.net/tcyjo7ok
Third try is a charm? At least the list of options is growing...
The only way to overlay two elements across email clients is through use of background images. Even this can be broken in some clients and requires a lot of conditional and reiterate code (backgrounds.cm is good resource for email bg images).
This is the only option that will display in MOST clients. Even this is still very restricted and not very agile to use (but that is true in ALL email coding). Most other techniques will only work for a couple clients and break completely in all others.

Increasing/Decreasing font size on button click

I am sure you guys must have seen that font resizing option on some website where they display alphabet "A" in small, medium and large sizes clicking on which changes the font size of website. I have two questions:
What is that thing called actually? Like if there is a term to describe it?
What arguments can I give against using this on website? One of the client has asked to incorporate it in website and I don't see any real benefit in using it so what arguments can I give to client against using it?
It is called "font size change options", or "font resizer".
Here is a simple and minimal 5 lines of code jQuery tutorial: http://www.programming-free.com/2013/12/increase-decrease-font-size-jquery.html
A bit of the code that enlarges the font size:
newFontSize= parseInt($('#content').css('font-size')) + 2;
$('#content').css('font-size', newFontSize);
The user could just use CTRL+ in browser. The problem is that the final user doesn't know this trick.
This is a fast and simple implementation, no need to convince the client against it. I find myself getting hard to see clear small text after 10 hours of programming. Maybe the client has sight problems and needs to address others like him.
"As of jQuery 1.6, .css() accepts relative values similar to .animate(). Relative values are a string starting with += or -= to increment or decrement the current value. For example, if an element's padding-left was 10px, .css( "padding-left", "+=15" ) would result in a total padding-left of 25px."
Reference
So to do that you can use a function callback which will return the actual value, then you return the new value.
Like the following.
$("#fontPlusBtn").click(function (){
$("#textDiv > *").css("font-size", function(i, value) {
return parseInt(value) * 1.1;
});
});
Working Demo for Increasing Font Size on Button Click:
I hope this helps you as you described font size change on Button Click.
What is the target group of your client? Adding such feature is generally considered good practice of web accessibility. It doesn't really take up too much space on the screen and doesn't mess with the design but gives users the options to enlarge the text in case they are having troubles reading the text.
I wouldn't try to argue against it but instead find a neat way to implement the functionality.
BBC's accessibility policy is a good read: http://www.bbc.co.uk/accessibility/best_practice/policy.shtml