How to adjust the height of document viewer in IPOD using titanium? - titanium

I have PDF , to view that pdf i have used document viewer
var viewer = Ti.UI.iOS.createDocumentViewer({
url:"Barcode.pdf",
height:'100%',
bottom:0
});
viewer.show();
The pdf will be displayed as center, top as title bar, but bottom as empty, I am unable to set the height as 100%. I have also used Ti.UI.FILL but still no use. Can any one please share the ideas.
Thanks in Advance,
Swathi.

Your example is correct. The height of your viewer component is filling the height of the parent component.
The issue you have is related to the specific pdf document you're using. I don't know which is the ratio (width/height) of your document, but if it's greater then your device screen ratio you will have something like this:
If you try to zoom in then the entire screen of your device will be used!
Only in two cases the entire screen will be completely used:
if the document ratio is smaller then the screen ratio (try with a document with a very small width)
if the document has many pages
If you are in the first case (document ratio > device screen ratio) and you want to have a well designed page then I suggest to just center the DocumentViewer instead of setting the height to 100%

Related

Resize height of picture and extend width

i have some picture which is 675x503. I would like to make more width on it and let's say to 1024 and in height to 400. How to do that without cutting my image and keep quality? I just would like to have this image on my website top. I got photoshop 6. I tried with Image->image size but its not what i need.
If you don't want to cut the picture at all, this will distort the image due to different height and width ratios. If this is not an issue, you could simply hit ctrl(or cmd)+t when the layer with the picture is selected. It will let you resize and rotate the entire image. There is also an option in the Image -> Image Size menu called "Bicubic Sharper", found in the drop-down list at the bottom of the menu(Photoshop CS6). It's meant for image reduction and should also solve your problem.

dijit.dialog - Dynamically Sized dijit.Dialog Not Centered

I'm having issues with correct sizing and positioning of digit.dialog.
I'm using the built in logic of dijit.dialog to determine the dialog width and positioning as it's content can be any size. In addition, the dialog content needs to be set via the href tag. If I start the browser window at 300px width, the right side of the dialog is all the way to the right. As soon as I manually resize the browser to the full width, and then shrink it, it adjusts the position. Sometimes it gets it correctly, but it's not consistent.
How do you get digit.dialog correctly so it displays it's content correctly for the first load time?
Please look at plunkr: http://plnkr.co/edit/FLO1VFWX2LbZeZAZuhYm?p=preview
new dijit.Dialog({
id: "modal",
href: "modal.html
});
Your content needs to have a fixed size. Otherwise The position is calculated with an inner size which is not relevant anymore after the sizing.
Basically, when re-sizing, the position is calculated using the previous width.
By calling multiple times the resize method, the dialog will adjust its position (a sort of binary search of the best position/size)
dialog.show().then(function() {
dialog.resize();
dialog.resize();
dialog.resize();
dialog.resize();
dialog.resize();
});
http://plnkr.co/edit/bhhAZlYOE6kIduxOX8cn?p=preview
But this is extremely ugly. You should consider giving a width of the content

Display a PDF in a webview

I want to display a pdf in a webview, but the chrome pdf plugin only shows a blank/grey rectangel.
Am I missing a permission in my manifest.json?
Ok, it looks like that if the width of the webview is set to a high value (in my case I set it to 10000) the pdf renders only a grey rectangel. Resetting the width to a more sane value brings back the pdf.

(PdfSharp) How do I use pdfsharp to change the page size of an existing pdf file?

I have a pdf file of the Legal page size, how do I change it to Letter size using PdfSharp?
PDFsharp includes a "Two Pages on One" sample. I'd use this as a starter; it draws two portrait pages on one landscape page. It can easily be changed to copy one portrait page onto a new portrait page.
Letter is larger than legal. So you must decide how to handle that:
scale the height to fit while maintaining the width
shrink height and width proportionally to keep the aspect ratio
keep page size truncating at the bottom keep page size
truncating at top and bottom (same or different stretches)
The first two options will work with any document, the final two could be appropriate if you know the documents and know you don't lose important information.

Producing bigger pages with a font editor for Cocos2d

I use Hiero, java version, because I want to create fonts for CCLabelBMFont.
However, due to my game being on retina display, my font images are big, and they require more than one page. Cocos2d only supports one.
So, essentially, how can I produce bigger pages (canvases)? I don't think Hiero has that feature.
Click on Glyph cache radio button. Then adjust Page width and Page height until it says Pages: 1. Then change the font size to the size you want. Re-adjust page width/height if the new font size increases the number of pages.
p/s: Make sure you adjust page width/height before increasing the size. Hiero will freak out if you suddenly change to a large size without changing the page width/height, and stop displaying the sample rendering. If that happens, you have to close and restart Hiero.