convert pdf to svg

Inkscape can also be used to convert PDF to SVG. It’s actually remarkably good at this, and although the code that it generates is a bit bloated, at the very least, it doesn’t seem to have the particular issue that you are encountering in your program. I think it would be challenging to integrate it … Read more

How can I flatten a XFA PDF Form using iTextSharp?

You didn’t insert a code sample to show how you are currently flattening the XFA form. I assume your code looks like this: var reader = new PdfReader(existingFileStream); var stamper = new PdfStamper(reader, newFileStream); var form = stamper.AcroFields; var fieldKeys = form.Fields.Keys; foreach (string fieldKey in fieldKeys) { form.SetField(fieldKey, “X”); } stamper.FormFlattening = true; stamper.Close(); … Read more

How to enable LTV for a timestamp signature?

This is the sample code this question is about: public void addLtv(String src, String dest, OcspClient ocsp, CrlClient crl, TSAClient tsa) throws IOException, DocumentException, GeneralSecurityException { PdfReader r = new PdfReader(src); FileOutputStream fos = new FileOutputStream(dest); PdfStamper stp = PdfStamper.createSignature(r, fos, ‘\0’, null, true); LtvVerification v = stp.getLtvVerification(); AcroFields fields = stp.getAcroFields(); List<String> names = … Read more

Script (or some other means) to convert RGB to CMYK in PDF?

This answer is not for Illustrator, but for ‘some other tool’, namely Ghostscript (download gs871w32.exe or gs871w64.exe). Ghostscript allows you to ‘re-distill’ PDFs (without an intermediate conversion to PostScript, the dreaded ‘refrying’ detour). Try this command: gswin32c.exe ^ -o c:/path/to/output-cmyk.pdf ^ -sDEVICE=pdfwrite ^ -dUseCIEColor ^ -sProcessColorModel=DeviceCMYK ^ -sColorConversionStrategy=CMYK ^ -sColorConversionStrategyForImages=CMYK ^ input-rgb.pdf And if you … Read more

Get rid of the white space around matlab figure’s pdf output

Exporting Figures for Publication is a good starting point. Instead of -deps use -dpdf for pdf output. You can fix the bounding box issue using the code below. set(gcf, ‘PaperSize’, [6.25 7.5]); set(gcf, ‘PaperPositionMode’, ‘manual’); set(gcf, ‘PaperPosition’, [0 0 6.25 7.5]); set(gcf, ‘PaperUnits’, ‘inches’); set(gcf, ‘PaperSize’, [6.25 7.5]); set(gcf, ‘PaperPositionMode’, ‘manual’); set(gcf, ‘PaperPosition’, [0 0 … Read more

How to determine artificial bold style ,artificial italic style and artificial outline style of a text using PDFBOX

The general procedure and a PDFBox issue In theory one should start this by deriving a class from PDFTextStripper and overriding its method: /** * Write a Java string to the output stream. The default implementation will ignore the <code>textPositions</code> * and just calls {@link #writeString(String)}. * * @param text The text to write to … Read more

Checking off pdf checkbox with itextsharp

You shouldn’t “guess” for the possible values. You need to use a value that is stored in the PDF. Try the CheckBoxValues example to find these possible values: public String getCheckboxValue(String src, String name) throws IOException { PdfReader reader = new PdfReader(SRC); AcroFields fields = reader.getAcroFields(); // CP_1 is the name of a check box … Read more