Do we have a simple example for DOMPDF? - dompdf

I downloaded dompdf from : https://github.com/dompdf/dompdf
I included the library in my application
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->set_paper('A4', 'Portrait');
$dompdf->render();
but i got the following error "/php-font-lib/classes/Font.php" is missing
Does anyone know where I can find a simple working example on how to get started with dompdf?

The php-font-lib folder is a link to a different repository: https://github.com/PhenX/php-font-lib
You should download that too and copy the contents of the src/FontLib folder as a 'classes' subfolder in the php-font-lib directory. Then you'll be able to load the Font class.

You downloaded the source code, which is more for developers. What you want to do is go to the dompdf releases page and click on one of the green download buttons (e.g. the one labeled dompdf-0.6.1.zip for the current release). These downloads include all the files you need.
There are other ways of getting dompdf as well. Go to the Easy Installation section of the read me for more information.

Related

Is it possible to use custom icon for Xcode file template?

In our project we generate multiple swift files when using the file xctemplate configuration. However, with this configuration, there is no icon displayed in Xcode when generating the files (see attached image). We did try to add two images to the template folder: TemplateIcon-png and TemplateIcon#96.png which yielded no success. Is it possible to use a custom icon for file templates in Xcode?
Not sure if you're still looking for an answer to this, but you should be able to create an .icns icon package named TemplateIcon.icns. This should contain your template image(s) to be displayed in the new project picker.
I suspect your issue was trying to use the PNG assets directly.
See the Base Acceptance Testing Bundle for an example. It is part of the OCSlimProjectXcodeTemplates repository.

adding a new theme in magento2

i have uploaded the files of the new theme bought from https://themeforest.net/user/codazon . But don't know where to move each individual files to the correct directories in order to add this new theme. Below is the files inside the new theme folder
Below are the screenshot of what's inside the Theme zip file.
It is hard to guess which theme you have purchase but they must be providing a detailed documentation of that theme through http or wrap inside theme package. For example i have found http://www.codazon.com/document/fastest/magento2/ is the documentation for their M2 Fastest theme from envatomarket page.
Codazon has to kind of zip files one is with complete Magento package and the other has only extension and it’s documentation. Please find out it’s extension zip file only .

SharpDX Content.Load<Texture2D>

I just installed SharpDX 2.5.0 into Visual Studio, and now there is one really curios and unexpected errror:
I wanted to start with Atari's 'Pong', so i drew a .bmp file with a ball, convertet it into a .dds file with
Easy2Convert BMP to DDS
added it to the Content, and tried to load it. So i added this line
ballTexture = Content.Load("Ball");
but it failed with the message AssetNotFoundException, the same with
ballTexture = Content.Load("Ball.dds");
and there are hardly no tutorials to find, neither did i find an useful answer...
Thats the full path to this picture:
H:\Programmieren\Pong\Pong\Content\Ball.dds
Looking forward to your answers, and please excuse my knowlegde, I was used to XNA, and it was much more easier...
In SharpDX.Toolkit content is loaded from a folder relative to the folder where your program is located. Also you should mark the texture with build action ToolkitTexture (open file properties in Visual Studio).
After build, the file should be copied to a path like this:
H:\Programmieren\Pong\Pong\bin\Debug\Content\Ball.tkb`
(the extension may be different - I don't remember exactly).
After this, you can load the asset by calling ballTexture = Content.Load(#"Content\Ball");
Alternatively, you can set the root path for content manager during initialization:
Content.RootDirectory = "Content";
...
//and load the textures with
ballTexture = Content.Load(#"Ball");
All this is demonstrated in SharpDX Toolkit samples (located in Samples\SharpDXToolkitSamples.sln).

jQUery chosen which files to include for using it

i am new to chosen.js .i download release 1.0.0 . when i download it contains a lot of file .in which i think we have to include chosen.min.css and chosen.jquery.min.js in our html page.i am confirming my assumption is correct or not ?? or we have to include other files also in our html page to run chosen method properly ??

Can't download files from the downloadable products folder directly from the product page

I've created a few downloadable products and added an mp3 file as the product.
Now instead of going through the checkout to download the file i wanted the user to be able to do it on the products page in view.phtml by clicking on a link
The problem i have is that i can't seem to download files which are in this downloadable folder
media/downloadable/files/links/t/o/toast_to_the_dead_-_immortal_technique.mp3
If i move that track to media/filename.mp3 ..or even in the wysiwyg folder then i can download it using my script. I've checked the file permissions etc and they're fine so im stuck as to why i can't download my files.
Does anyone know? or is there a way i can change the folder from downloadable to something else, as all i need downloadable products for is music files.
Cheers
Edit:
I should also add that i am getting the download box to save the file, with the correct file name and path, its just the file is 523 bytes, im using the code below to get the filepath
$mediaUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
$_linkpath = $mediaUrl."downloadable/files/links".$_link->getLinkFile();
If i were to change the link path to $mediaUrl."filename.mp3" etc then it would download..so seems to me that its the downloadable folder thats causing the problem?
Nevermind I've solved this, I just changed $_linkpath to
$_linkpath = "media/downloadable/files/links".$_link->getLinkFile();
The full url was causing the problem

Resources