libharu

小容量单片机生成pdf文件

瘦欲@ 提交于 2020-07-27 11:31:36
工作上要求使用小容量单片机生成直接生成pdf文件。 经过一段时间的摸索,其中参考了libharu,库太大,不适合在单片机上使用 页参考了与非网上一位前辈的库,占用的RAM太大,不适合小容量单片机, 主要资料是pdf1.7格式文件。 自己制作了一个pdf库,其中在text文件大小不足20k,占用ram不足1k, 可以生成简单的pdf文件。 pdf文件的书签,图片,流缩放,文件加密,文件加水印没有细看。 工作上不需要这些内容,以后需要再细看。 来源: oschina 链接: https://my.oschina.net/u/4404709/blog/4306183

小容量单片机生成pdf文件

江枫思渺然 提交于 2020-07-26 14:46:01
工作上要求使用小容量单片机生成直接生成pdf文件。 经过一段时间的摸索,其中参考了libharu,库太大,不适合在单片机上使用 页参考了与非网上一位前辈的库,占用的RAM太大,不适合小容量单片机, 主要资料是pdf1.7格式文件。 自己制作了一个pdf库,其中在text文件大小不足20k,占用ram不足1k, 可以生成简单的pdf文件。 pdf文件的书签,图片,流缩放,文件加密,文件加水印没有细看。 工作上不需要这些内容,以后需要再细看。 来源: oschina 链接: https://my.oschina.net/u/4370441/blog/4306172

Why specify particular library in Visual Studio if the path to lib is known? [closed]

戏子无情 提交于 2020-01-25 20:26:47
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . TL/DR: Question start with steps that I've made and that I think are important to mention (let me know if it is not important and I will delete it). The question itself is in the bottom of page. I've posted 3 questions that has the same steps that I've issued before asking the

Proper way to compile project with debug symbols and cmake

不羁的心 提交于 2020-01-17 05:59:32
问题 Here is recommended to pass CMAKE_BUILD_TYPE as an argument to cmake when I want to obtain debug or release project builds. I'm trying to compile libharu with cmake and I would like to compile it with debug symbols. I've searched CMakeLists.txt included in libharu for following strings: CMAKE_BUILD_TYPE CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_DEBUG but I've found nothing. My question is that if it does make any sense to specify CMAKE_BUILD_TYPE when libharu's CMakeLists.txt doesn't mention it? If

HPDF_SetCompressionMode() not working in Libharu

戏子无情 提交于 2020-01-07 03:02:38
问题 I am generating Pdf files using LibHaru libraries. My code is following #include <iostream> #include "hpdf.h" using namespace std; void error_handler(HPDF_STATUS error_no, HPDF_STATUS detail_no, void *user_data) { } int main() { cout<<"Compression"<<endl; HPDF_Doc pdf = HPDF_New(error_handler, NULL); if (!pdf) return 0; HPDF_STATUS Status = HPDF_SetCompressionMode(pdf, HPDF_COMP_ALL); return 0; } PROBLEM: I debugged the code and found that HPDF_SetCompressionMode() returns 4129 , which is the

German text not proper on PDF created by Libharu C++

左心房为你撑大大i 提交于 2019-12-23 15:38:06
问题 I have to write German text on a pdf created by Libharu. I assign German Text to a string variable (i.e. std::string TestString = "VariableGesamtlänge"; ) and then put that text to a pdf. My simple code is following: //-----UTF8 Encoding HPDF_UseUTFEncodings(pdf); HPDF_SetCurrentEncoder(pdf, "UTF-8"); const char *fontname = HPDF_LoadTTFontFromFile(pdf, "FreeSans.ttf", HPDF_TRUE); HPDF_Font font = HPDF_GetFont(pdf, fontname, "UTF-8"); HPDF_Page_SetFontAndSize(page, font, 24); std::string

utf8 in libharu: is embedding fonts really necessary?

∥☆過路亽.° 提交于 2019-12-18 09:18:54
问题 I'm trying to support as much Unicode as I can in the PDF files I'm writing. I want to be able to output utf8 strings and have them display correctly in the PDF. I see in the libharu encodings documentation (https://github.com/libharu/libharu/wiki/Encodings) that there are many single-byte code pages I can access, and special functions for accessing multi-byte code pages if I want Chinese, Japanese, and Korean. But my understanding if that if I wanted to use all of those pages and functions

Why Memory allocation failed whe HPDF_LoadPngImageFromFile using libhpdf?

对着背影说爱祢 提交于 2019-12-13 08:52:59
问题 I got a exception ERROR: error_no=1015, detail_no=0 using HPDF_LoadPngImageFromFile to load a png file with a jpeg file extention.I have libpng and libpng-dev installed. I can not figure out why this exception occurs. Anyone help me? Thanks. 回答1: LOL,I had compile libaru demo already....thanks stackoverflow..and libharu developer. ERROR: error_no=1015, detail_no=0 general , you must check your image file weather or not exist in current directory. indicate you c program want to load something

Why so big difference in sizes of almost identical documents

百般思念 提交于 2019-12-11 18:05:32
问题 Have two pdfs, first created with libharu and second created with PDF::API2. If not mention to coordinates then content is the same. But first pdf oversize second by four times. Only one distinction what i found that is type of fonts embedding showed in document properties fonts tab. In first Verdana (Embedded Subset) Type: TrueType Encoding: Custom In second Verdana Type: TrueType Encoding: Custom Actual Font: Verdana Actual font Type: TrueType How to deal with that embedded subset? 回答1:

Read Pdf with C

雨燕双飞 提交于 2019-12-10 15:38:00
问题 I want to be able to read the content of pdf files. I need to do that with C on Linux. The closer i can get to this was here but I think Haru can only create pdf and is not able to read them (not 100% sure). PS: I only need the plain text from pdf 回答1: Check out libpoppler. I've never used it work extracting text, just querying PDF attributes. It's pretty easy to use. 回答2: How well do you need to parse them? Just extracting strings should be relatively easy, fully accurate rendering is harder